APIs & Integrations

aawadhwa
Participant

Custom Object to Custom Object - join records retrieved from API

SOLVE

Hello, 

 

We are begnining to work with custom object to extend the capabilities, I have been able to create custom objects and retrieve the data that we put in it. 

 

There is this case, however, where we have custom_object_2 associated with custom_object_1. 

I use GET crm/v3/objects/custom_object_2&properties=name to get all the records with properties

The response returned looks like this 

"results": [
{
"id": "2090784302",
"properties": {
"hs_createdate": "2022-08-04T20:53:06.993Z",
"hs_lastmodifieddate": "2022-08-04T20:53:06.993Z",
"hs_object_id": "2090784302"
},
"createdAt": "2022-08-04T20:53:06.993Z",
"updatedAt": "2022-08-04T20:53:06.993Z",
"archived": false
} ]

The above response doesn't contain any identifier which can be used to link it to the custom_object_1.

Does anyone know what parameters needs be passed where this API can return some identifier to associate the records of custom_object_2 with that of custom_object_1? Or is there any other way or exta API call that needs to be made? 
 
Thank you in advance!
0 Upvotes
1 Accepted solution
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Object to Custom Object - join records retrieved from API

SOLVE

Hi @aawadhwa , 

 

You can call the associations endpoint to list all the associations for your current object. So in the case of 'custom_object_2' the URL could look something like this:

https://api.hubapi.com/crm/v3/objects/custom_object_2/2090784302/associations/custom_object_2?limit=...



Did my answer solve your issue? Help the community by marking it as the solution.

View solution in original post

2 Replies 2
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Object to Custom Object - join records retrieved from API

SOLVE

Hi @aawadhwa , 

 

You can call the associations endpoint to list all the associations for your current object. So in the case of 'custom_object_2' the URL could look something like this:

https://api.hubapi.com/crm/v3/objects/custom_object_2/2090784302/associations/custom_object_2?limit=...



Did my answer solve your issue? Help the community by marking it as the solution.
aawadhwa
Participant

Custom Object to Custom Object - join records retrieved from API

SOLVE

Thank you @Teun , this worked! 

0 Upvotes