To allow our API partners to efficiently retrieve higher volumes of applications, we support pagination for offers, subscriptions, and allocations. This means we’re dividing a large set of data into smaller, manageable batches. Instead of retrieving all the data in a single response, the API returns just a small subset and users can subsequently poll for additional pages.
Specifically, partners can request to receive an allocation webhook without a payload, in a “notification” format that only indicates the allocation count. They can then poll the GET/allocations endpoint with two query parameters to retrieve paginated responses.
Query parameters
We implement offset-based pagination, so the two parameters you need to use are offset and limit.
- Limit: The maximum number of entries to return. In case you enter a value that exceeds it, this limit is applied by default.
- Offset: The starting point (the first item to return from the collection). We operate a zero-based offset, therefore, in this case, “0” is a correct value. You can request subsequent pages by incrementing the offset.
Passing no parameters will return all offers, subscriptions or allocations, depending on which of these endpoints you’re calling.
Sample request
Let’s assume you would like to view a list with the first 100 allocations for the offerId of "9999-1234-1234-abcd". The request for retrieving the first 100 allocations looks like this:
curl --request GET \
--url https://api.primarybid.fr/allocation/9999-1234-1234-abcd&limit=100&offset=0 \
--header 'accept: application/json'
Next, you can use the following API call to view a list with the next 100 allocations (from #101 to #200):
curl --request GET \
--url https://api.primarybid.com/allocation/9999-1234-1234-abcd&limit=100&offset=100 \
--header 'accept: application/json'