Coder Social home page Coder Social logo

Comments (7)

IsraelOrtuno avatar IsraelOrtuno commented on August 24, 2024

Let me have a look....

from pipedrive.

IsraelOrtuno avatar IsraelOrtuno commented on August 24, 2024

Seems like API gets another parameter called start, does it mean current page?

https://developers.pipedrive.com/docs/api/v1/#!/Persons/get_persons_id_activities

from pipedrive.

ampkeegan avatar ampkeegan commented on August 24, 2024

Yes, pagination works the same as other requests, like to get all deals. First request would be start=0, limit=500, second request would be start=500, third is start=1000, etc. Check the response for ['additional_data']['pagination']['more_items_in_collection'] = True to continue requesting.

from pipedrive.

IsraelOrtuno avatar IsraelOrtuno commented on August 24, 2024

Yeah, not sure if at this point we can implement something like pagination without any breaking changes. Since they do not have a "page" parameter, I'd say the solution would be to watch those response headers and request more manually...

Any idea how to deal with that respecting the current structure?

from pipedrive.

ampkeegan avatar ampkeegan commented on August 24, 2024

My php isn't strong enough to understand exactly what's happening in the source, but do the other objects->all() function not paginate? If they do it's the same process.

from pipedrive.

ampkeegan avatar ampkeegan commented on August 24, 2024

Looking at the response object from this call:

$acts = (array)$this->pd->persons()->activities($opts, ["limit" => 2])->getContent();

I see this in $acts['additional_data''] :

"pagination":{
"start":0,
"limit":2,
"more_items_in_collection":true,
"next_start":2
}

The second params to listActivities() takes in the start param as well, so I could write a for loop to paginate myself,

$acts = (array)$this->pd->persons()->activities($opts, ["limit" => 2, "start" => 2])->getContent();

from pipedrive.

IsraelOrtuno avatar IsraelOrtuno commented on August 24, 2024

As of now, this is the way to go.

Since they do not have a traditional pagination system, this was not taken into account when building this package. Nobody has previously requested this functionality but will consider an implementation of an V3 if becomes an issue in future and simplify the pagination.

from pipedrive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.