Hi,
I am trying to fetch all associated line items of a deal, for this I use the V3 Associations API. The deal I am querying has a lot of line items (268). According to the documentation, if there are more than 100 associations found, they will be paginated in pages of 100 each.
So I start by making the request below to get the first page of 100 associated line items:
Endpoint: POST https://api.hubapi.com/crm/v3/associations/deal/line_item/batch/read
Request body:
{
"inputs": [
{
"id": {{deal_id}}
}
]
}
The first request runs correctly and returns the first 100 line items associated to the deal. The response also provides the pagination data.
When adding the pagination data to the request body, the same 100 associated line items are returned with the same “after” value. So the pagination does not seem to be working on the Associations Batch API.
Endpoint: POST https://api.hubapi.com/crm/v3/associations/deal/line_item/batch/read
Request body:
{
"inputs": [
{
"id": {{deal_id}}
}
],
"paging": {
"next": {
"after": {{offset_id_from_response}}
}
}
}
However, when querying the endpoint provided by the “link” property, the next 168 associated line items are returned without further pagination. I also noticed that the “link” contains an endpoint from the CRMv3 Objects API and not the Associations API.
Is it expected behavior that querying associations using the Objects API returns all the associations without pagination?
And regarding the Assocations API, how should the pagination be implemented in the request to get the next set of 100 associated line items?
Thanks in advance and best regards,
Maxime E.