I’m new to hubspot and I’m confused with a small little thing;
I have a custom object named “Custom Engagements” and I wanted to get all records via API, I used different formats with no luck;
https://api.hubapi.com/crm/v3/objects/contact+engagements
https://api.hubapi.com/crm/v3/objects/contact%20engagements
https://api.hubapi.com/crm/v3/objects/contact_engagements
https://api.hubapi.com/crm/v3/objects/contactengagements
Appreciate if someone could helo me out and tell me what did I overlook here.
Hi @adnandmth,
You may need to double check the internal name of the custom object, which usually contains an underscore for multiple words.
To find that, go to Settings > Objects > Custom Objects, then select “Edit custom object”:
You will then see the “Internal name” displayed below the “Object name (Plural)” field. In this case, it would be “custom_cars”:
Then you would use: https://api.hubapi.com/crm/v3/objects/custom_cars
Also, see a community solution here if you need to retrieve properties as well:
https://community.hubspot.com/t5/APIs-Integrations/Retrieve-Records-for-a-Custom-Object-including-all-custom/m-p/848202
Hope this helps!
Hi Evaldas, thank you for your suggestion.
I tried the following;
Copied the internal label name from the object configuration;
Tested it in postman and got the following error response;
When tested using another custom object with no space in the internal name it worked;
It’s odd behavior which I’m struggling to understand.
@adnandmth - I confirmed with HubSpot that this API can run into issues when a custom object contains multiple words.
However, as @Stegemann suggested, the workaround would be to use “objectTypeId” instead of “objectType” (which should correspond to the “internal name”).
In order to get the the “objectTypeId” for your custom object ID, you will need to make a call to the “Get all schemas” endpoint (GET/crm/v3/schemas) and find the “objectTypeId” for your custom object in the response.
There is currently no timeline for patching up that issue in the API, but the workaround should give you what you need!
It worked! thank you so much!!
Sometimes I have more luck with the object ID found in the url of the custom object. Format --> 2-12345678
Good luck!