APIs & Integrations

gavina
Member

Properties not returned by get all companies endpoint

SOLVE

Can anybody advise why properties are not returned by the get all companies endpoint (/companies/v2/companies/paged)?

 

Using none, and also specific 'property=' parameters in the request do not return any.

example response section:

 

[
{"portalId":xxxxxxx,"companyId":yyyyyyyyyy8,"isDeleted":false,"properties":[],"additionalDomains":[],"stateChanges":[],"mergeAudits":[]},
{"portalId":xxxxxxx,"companyId":yyyyyyyyyy9,"isDeleted":false,"properties":[],"additionalDomains":[],"stateChanges":[],"mergeAudits":[]},
{"portalId":xxxxxxx,"companyId":yyyyyyyyyy0,"isDeleted":false,"properties":[],"additionalDomains":[],"stateChanges":[],"mergeAudits":[]},
{"portalId":xxxxxxx,"companyId":yyyyyyyyyy1,"isDeleted":false,"properties":[],"additionalDomains":[],"stateChanges":[],"mergeAudits":[]}
...
]


requested with:
https://api.hubapi.com/companies/v2/companies/paged?limit=250&offset=0&property=propname_1&property=...

 

I know the properties exist on the companies as navigating to the companies on the site shows them on the page, and they are additionally listed in the response for the /properties/v1/companies/properties endpoint.

 

ps: the properties are returned as expected for the get all contacts endpoint (contacts/v1/lists/all/contacts/all)

 

 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Properties not returned by get all companies endpoint

SOLVE

Hi @gavina,

 

You're definitely on the right track but there is a slight differences between the Get all companies API and Get all contacts API on how the query parameter is include to specific property in the return response.

 

For the Get all contacts API, to include other property aside from the default one, we use the &property parameter.

 

For the Get all companies API, to include other property aside from the default ones, we use the &properties parameter.

 

If you change the request url to something like this

https://api.hubapi.com/companies/v2/companies/paged?limit=250&offset=0&properties=propname_1&properties=

it should work just fine.

View solution in original post

0 Upvotes
2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Properties not returned by get all companies endpoint

SOLVE

Hi @gavina,

 

You're definitely on the right track but there is a slight differences between the Get all companies API and Get all contacts API on how the query parameter is include to specific property in the return response.

 

For the Get all contacts API, to include other property aside from the default one, we use the &property parameter.

 

For the Get all companies API, to include other property aside from the default ones, we use the &properties parameter.

 

If you change the request url to something like this

https://api.hubapi.com/companies/v2/companies/paged?limit=250&offset=0&properties=propname_1&properties=

it should work just fine.

0 Upvotes
gavina
Member

Properties not returned by get all companies endpoint

SOLVE

Many thanks Wendy,

 

I've update to match the correct param name and it works as expected now! I'll pay more attention to different endpoint definitions.


Thanks,

 

Gavin

0 Upvotes