Search code examples
apiprojectactivecollab

ActiveCollab API return all active projects


We have problem with API from ActiveCollab. We are using this API point:

https://app.activecollab.com/117236/api/v1/projects/

but it is not returning all active projects. For example there is not included project "CrossMasters: Marketing" (https://app.activecollab.com/117236/projects/7).

Can you help us with that? Just a few days ago, it worked.


Solution

  • Projects API is paginated, and it returns 50 projects with latest activity. You can access other pages by adding page GET attribute. For example, you can request second page of projects by calling:

    https://app.activecollab.com/117236/api/v1/projects?page=2

    You can check pagination headers to see how many projects are there actually, and implement a loop based on that information, or simply go page by page until you get to a page that returns no results. More info about this can be found in this StackOverflow answer:

    https://stackoverflow.com/a/40020858/338473