Default Paging and Sorting order for v4 associations result

Hi, I want to check regarding default paging and sorting order for v4/associations api.
I am using this endpoint
crm/v4/associations/companies/calls/batch/read
and this is giving me the whole result without any pagination, so can i expect that there is no pagination in this since it is even giving me an object having more than 300 associations.
Secondly i want to know regarding default sorting order of the result for this api. It is giving list of associated object ids but i am confused about the order of sorting it is returning, is it on create date, last modified or on what basis. Any help on these points would be greatly appreciated.

Hey, @random :waving_hand: Thanks for your question! I agree with you, neither expected behaviour is listed in the documentation for these endpoints. My instinct is the associations to a specific object are listed in the order they were added. Which could very well result in a non-liner result being returned. For pagination, here’s what the endpoint offers — “The ‘after’ field in a returned paging object can be added alongside the ‘id’ to retrieve the next page of associations from that objectId.” (emphasis mine)

In your result with 300+ associations for a specific company, are you getting a value for `after` in the response? Can you share an example response?

Best,

Jaycee

Hi @Jaycee_Lewis
Thanks for your reply. Regarding sorting order of the result, can we verify if it is actually coming in order of association since it helps me to manage the large dataset if it is the case.
For pagination, i am not getting any paging object in the response, and instead getting the whole result. Also i want to know the input limit, that is also not mentioned. Please find the example response below,

{
 "status": "COMPLETE",
 "results": [
 {
 "from": {
 "id": ""
 },
 "to": [
 {
 "toObjectId": ,
 "associationTypes": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 181,
 "label": null
 }
 ]
 },
 ..................
 {
 "toObjectId": 
 "associationTypes": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 181,
 "label": null
 }
 ]
 }
 ]
 }
 ],
 "startedAt": "2024-01-10T05:15:42.016Z",
 "completedAt": "2024-01-10T05:15:42.024Z"
}

Hi there,

I’ve a similar issue/question - I’ve managed to get the ‘after’ functionality to work before on other objects, but because the endpoint returns the data in date created order, I’d have to send multiple calls just to get to the latest associations - seems a bit nuts. Is there an alternative endpoint which can return most recent associations created first?

Thanks!

Phil