kekekeks / pipedrive-net

.NET client for Pipedrive API ( https://developers.pipedrive.com/v1 )
MIT License
12 stars 13 forks source link

Paging through records #10

Open tqrecords opened 8 years ago

tqrecords commented 8 years ago

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 commented 8 years ago

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

tqrecords commented 8 years ago

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 commented 8 years ago

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