Thanks for your message and sorry it has taken me a few days to get back to
Response pagination isn’t a limit of your trial account, it’s the default
behaviour for all our API endpoints.
We spread the data across multiple pages to avoid flooding your integration
with enormous response bodies.
It’s not uncommon for our older and busier accounts to have hundreds of
even thousands of contacts, projects and invoices.
If all invoices (for example) were to be enumerated in a single response,
the payload would be enormous!
If the pagination is getting in the way, there are certain headers you can
set to make things easier.
For example, rather than the default 25 items per page, you can request
(upto) 100 items in a single response. That way, you can fetch an entire
collection of entities (invoices, contacts) in fewer API requests:
You can also easily jump to the last page of pagination using the URLs in
the “Link” header at the top of each response:
Note that the page number is included as an argument in the URL, so once
you know the number of the “last” page, you can easily determine how many
pages need to be traversed to ensure you gather all of the data.
To answer your final question, about parsing a project ID from the URL, you
should be able to reference the project using the absolute (full) URL
Infact, that’s the way our API is designed to handle all references to
existing entities, using their full URL (rather than purely their ID).
I hope this helps to get you started!
Dave JOn 21 January 2015 at 15:56, firstname.lastname@example.org wrote:
Can you explain why the API uses pagination, is this a limit on my trial
account? I’m running into some limitations and it seems to stem from only
been given 25 results per request. I’ve looked into it and found the
documentation which mentions the pagination but I don’t understand the
reasons for it.
If I want to output a list of all projects and all contacts but to do so I
have two choices;
1, import all api results into my own database and run this on a
cron/schedule to make sure we get all items.
2, somehow figure out how many projects are on the system in total and
work out how many pages there are and then begin getting the api results
one page at a time.
Both of these causes problems, how am I supposed to give the user the
ability to show all projects where Organisation Name = Test if I cannot get
a list of all projects to begin with?
Am I missing something in the documentation or not understanding what
features the API provides? Can I get a list of filtered projects via the
Also, to look up a single project or update it you need the ID but this
only seems to be included in the response as part of the URL so I had to
parse the URL to get ID, is this how it is supposed to be done? Why is the
ID not included as a standalone field in the project data?
You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.
Senior Support Engineer