Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging through records #10

Open
tqrecords opened this issue Jun 21, 2016 · 3 comments
Open

Paging through records #10

tqrecords opened this issue Jun 21, 2016 · 3 comments

Comments

@tqrecords
Copy link
Contributor

The following returns the first 100 records from the deals endpoint.

var deals = await client.Deals.All;

Is there a way to page through the records or return all of them?

@kekekeks
Copy link
Owner

kekekeks commented Jun 23, 2016

It seems that their api was changed in some way. It was returning all deals before.

@tqrecords
Copy link
Contributor Author

This is the response I got back from Pipedrive support (pretty much copied and pasted from the docs):

Most of the lists/item collections are paginated. The parameters that control the pagination are 'start' and 'limit', indicating the desired offset and the items per page values. Within the response's 'additional_data' object, a 'pagination' object will be set upon pagination. The 'additional_data.pagination' will contain the given start and limit, as well as 'more_items_in_collection' flag, indicating whether there are more items that can be fetched after the current batch. When there are, 'next_start' will also be set which can be used for next offset pointer. Maximum 'limit' value is 500. Just set these values as parameter and it should be fine.

Is there a way we can pass in the 'start' and 'limit' params?

@tqrecords
Copy link
Contributor Author

FYI

The api seems to bring back 100 records by default (I'm using the javascript api for now). I guess we need to pass in the 'limit' and 'next_start' values as well as getting the 'more_items_in_collection' flag (pagination object) in order to page through the records.

It appears the max limit you can set is 500.

Source: https://developers.pipedrive.com/v1 - Pagination and Lists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants