CMS Development

JBrake
Contributor | Elite Partner
Contributor | Elite Partner

crm_assoctions vs. api request. Equivalent functionality?

Hi there,Is there a way using the HS API to do the equivalent of (variable not listed do have values, just not listed here):

 

{% set query = "meeting_owner_id=123&limit=10&order=-start_date" %}
{% set meetings = crm_associations(associationid, "USER_DEFINED", associationtypeid, query, meeting_properties, false ) %}

 

Where you can paginate the results via the api so I dont need to reload the page, just add more to the page (e.g. &offset=10). It seams as though associations via the api don't allow queries - i may be mistaken...I can load all associations but those association may not have the correct with meeting_owner_id, which then throws off any pagination of the association verses my actual target data.

0 Upvotes
3 Replies 3
miljkovicmisa
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

crm_assoctions vs. api request. Equivalent functionality?

Hello @JBrake , thanks for writing, you can use the parameters "limit" and "offset" in the endpoint of the associations API as per documentation. You can also do a number of things as well as create a single page navigation that doesn't need any refreshing to be done so it's all done in a single call (as long as you meet the limits of the api call), I have done this previously using a library called pagination.js .
Here in this link you will find the documentation on the API for the associations.

If you need any further assistance regarding the call don't hesitate to write.
If my answer was helpful please mark it as a solution.

JBrake
Contributor | Elite Partner
Contributor | Elite Partner

crm_assoctions vs. api request. Equivalent functionality?

Thanks for taking the time @miljkovicmisa The problem is not the associations (I've got that all good) but the filtered results of the associations may/will not be the same amount of records. As there are results in the associations that not all users are allowed to see, hence the "meeting_owner_id=123" filter in the query, which only returns associated records with that meeting_owner_id, where as with the api I would need to get all the associations, load them and then select only the ones with that meeting_owner_id, of which would most likely be less...

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

crm_assoctions vs. api request. Equivalent functionality?

@miljkovicmisa  is going to be your best resource here!

0 Upvotes