APIs & Integrations

pyrex41
Participant

Custom Object Endpoints?

SOLVE

I'm trying to work with some custom objects via the API, and i cannot find an endpoint that will show me all the properties of a specific instance(s) of a custom object.

 

Pulling my hair out here...how do i find the property values set in the webapp for the custom object?

 

Partial snip of the schema (can also use the properties api)Partial snip of the schema (can also use the properties api)only 3 of the 54 properties show uponly 3 of the 54 properties show upThere are 54 different properties that should be hereThere are 54 different properties that should be here

0 Upvotes
3 Accepted solutions
Jaycee_Lewis
Solution
Community Manager
Community Manager

Custom Object Endpoints?

SOLVE

Hi, @pyrex41 👋 Have you already tried using the Search API endpoints? For example, you can set up your request to include all the properties you want returned — Specify returned properties. 

You can include additional properties in the query param, but be aware there is a character limit. For example, 'https://api.hubapi.com/crm/v3/objects//?properties=test1%2C%20test2%2C%20test3&archived=false'
Dealing with this character limit is where the Search API is handy.

 

Hey, @nikodev @KyleParker @RMones, do you have any additional tips or thoughts? 

 

Thank you for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

View solution in original post

nikodev
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Custom Object Endpoints?

SOLVE

Hey there @pyrex41

Based on the API response you've posted, you're making requests related to the object schema, opposed to specific object instances as it seems you're trying to. 
I'm going to link you to another post I replied on where I describe using the search endpoint to find records matching specified criteria. Link HERE

It provides a bit more detail around the exact route @Jaycee_Lewis  is encouraging you to take. 

Instead of going to the "Object schema" tab of the documentation, choose the "Objects" tab in the middle. Screenshot below with the correct tab highlighted. 

Screen Shot 2022-09-12 at 2.36.24 PM.png

You could also use the read endpoints found in that same tab, if you have the ID(s) of the records you're searching for. 

Hope this helps. 

Thanks for the tag @Jaycee_Lewis


 

 

 

A8 Labs

View solution in original post

KyleParker
Solution
Contributor

Custom Object Endpoints?

SOLVE

I would echo this approach. We use a similar approach when we need to retrieve custom object (or even standard) object data from HubSpot.

 

As par of our integrations, we pull all properties to a local SQL Server table once a day (can obviously be more frequent, depending on how often you add new properties). When a call is made to the /search endpoint, we first make a call to that table and retrieve a comma separated list of all the properties for that object. That value is then included in the search payload.

 

Another approach to ensure you get all available data for an object is to implemente webhooks in a HubSpot workflow. You can define whatever enrollment trigger works for your scenario and then set up an endpoint to accept the incoming data from the webhook. By default, the webhook will send all data for all applicable properties on that object. We found this especially helpful - not only do we not have to poll the HubSpot APIs looking for data changes, but we don't have to specific the properties we want - the webhook sends everything that's populated for that specific record.

 

Good luck in your implementation!
Kyle

View solution in original post

5 Replies 5
nikodev
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Custom Object Endpoints?

SOLVE

Hey there @pyrex41

Based on the API response you've posted, you're making requests related to the object schema, opposed to specific object instances as it seems you're trying to. 
I'm going to link you to another post I replied on where I describe using the search endpoint to find records matching specified criteria. Link HERE

It provides a bit more detail around the exact route @Jaycee_Lewis  is encouraging you to take. 

Instead of going to the "Object schema" tab of the documentation, choose the "Objects" tab in the middle. Screenshot below with the correct tab highlighted. 

Screen Shot 2022-09-12 at 2.36.24 PM.png

You could also use the read endpoints found in that same tab, if you have the ID(s) of the records you're searching for. 

Hope this helps. 

Thanks for the tag @Jaycee_Lewis


 

 

 

A8 Labs

Jaycee_Lewis
Solution
Community Manager
Community Manager

Custom Object Endpoints?

SOLVE

Hi, @pyrex41 👋 Have you already tried using the Search API endpoints? For example, you can set up your request to include all the properties you want returned — Specify returned properties. 

You can include additional properties in the query param, but be aware there is a character limit. For example, 'https://api.hubapi.com/crm/v3/objects//?properties=test1%2C%20test2%2C%20test3&archived=false'
Dealing with this character limit is where the Search API is handy.

 

Hey, @nikodev @KyleParker @RMones, do you have any additional tips or thoughts? 

 

Thank you for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

pyrex41
Participant

Custom Object Endpoints?

SOLVE

Thank you all, it looks the issue was that I did not specify the properties i wanted in the search query (`?properties=prop1, prop2, prop3`). What I was getting was only the default parameters (I'm assuming; I can't find anywhwere that specifies what the default parameters for custom objects are). The documentation says "Control what is returned via the properties query param." -- I understood this to mean you could *limit* the properties returned, but that no specification would return all properties.

This gives what i would expect:

Screen Shot 2022-09-12 at 1.12.19 PM.png

 

KyleParker
Solution
Contributor

Custom Object Endpoints?

SOLVE

I would echo this approach. We use a similar approach when we need to retrieve custom object (or even standard) object data from HubSpot.

 

As par of our integrations, we pull all properties to a local SQL Server table once a day (can obviously be more frequent, depending on how often you add new properties). When a call is made to the /search endpoint, we first make a call to that table and retrieve a comma separated list of all the properties for that object. That value is then included in the search payload.

 

Another approach to ensure you get all available data for an object is to implemente webhooks in a HubSpot workflow. You can define whatever enrollment trigger works for your scenario and then set up an endpoint to accept the incoming data from the webhook. By default, the webhook will send all data for all applicable properties on that object. We found this especially helpful - not only do we not have to poll the HubSpot APIs looking for data changes, but we don't have to specific the properties we want - the webhook sends everything that's populated for that specific record.

 

Good luck in your implementation!
Kyle

pyrex41
Participant

Custom Object Endpoints?

SOLVE

Thanks Kyle -- the webhooks approach looks like it could be a better solution.

0 Upvotes