APIs & Integrations

rainsfordt
Member

I can't seem to find address information such as City and Postcode in returned JSON

SOLVE

Hi there,

I am calling the 'Return all companies' API and this is an example of twitter as a company in my hubspot being returned. I can't seem to find where values such as Post Code, Town, Country, City etc are? In the API companies overview you can see it in the example. Can someone please advise what I am missing here as I really need these values?
Thanks very much in advance,
Toby

{
"portalId": 4723141,
"companyId": 858505904,
"isDeleted": false,
"properties": {
"website": {
"value": "twitter.com",
"timestamp": 1531316462651,
"source": "CALCULATED",
"sourceId": null,
"versions": [{
"name": "website",
"value": "twitter.com",
"timestamp": 1531316462651,
"source": "CALCULATED",
"sourceVid": []
}]
},
"address": {
"value": "1355 Market Street",
"timestamp": 1531316462651,
"source": "BIDEN",
"sourceId": "xxxxxx",
"versions": [{
"name": "address",
"value": "1355 Market Street",
"timestamp": 1531316462651,
"sourceId": "xxxxxx",
"source": "BIDEN",
"sourceVid": []
}]
},
"name": {
"value": "Twitter",
"timestamp": 1531316462651,
"source": "BIDEN",
"sourceId": "xxxxxx",
"versions": [{
"name": "name",
"value": "Twitter",
"timestamp": 1531316462651,
"sourceId": "xxxxxx",
"source": "BIDEN",
"sourceVid": []
}]
}
},
"additionalDomains": [],
"stateChanges": [],
"mergeAudits": []
}

0 Upvotes
1 Accepted solution
TrujayJay
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

I can't seem to find address information such as City and Postcode in returned JSON

SOLVE

Hi Toby,

Are you specifying these properties in your API call? Here's some additional info from the API documentation:

_> 'properties=' - Used to include specific company properties in the results. By default, the results will only include the company ID, and will not include the values for any properties for your companies. Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties. _
> Note: Companies that do not have a value set for a property will not include that property, even when you specify the property. A company without a value for the website property would not show the website property in the results, even with &properties=website in the URL.

So, the properties you'll want to include are:
zip
city
country
(and any other custom properties you're interested in)

Best,
Nina

Trujay | Noah Hendricks

View solution in original post

3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

I can't seem to find address information such as City and Postcode in returned JSON

SOLVE

Hi @rainsfordt,

You'll want to check out the Properties API of the object you're querying, since the full list more than likely includes custom properties:

Get all Company Properties | Company Properties API

GET /properties/v1/companies/properties/ - Endpoint to get all company properties.

0 Upvotes
TrujayJay
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

I can't seem to find address information such as City and Postcode in returned JSON

SOLVE

Hi Toby,

Are you specifying these properties in your API call? Here's some additional info from the API documentation:

_> 'properties=' - Used to include specific company properties in the results. By default, the results will only include the company ID, and will not include the values for any properties for your companies. Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties. _
> Note: Companies that do not have a value set for a property will not include that property, even when you specify the property. A company without a value for the website property would not show the website property in the results, even with &properties=website in the URL.

So, the properties you'll want to include are:
zip
city
country
(and any other custom properties you're interested in)

Best,
Nina

Trujay | Noah Hendricks
rainsfordt
Member

I can't seem to find address information such as City and Postcode in returned JSON

SOLVE

Hi Nina,

I feel so stupid. Absolutely perfect. Thank you so much!

Is there somewhere I can see a list of all the properties each API call can include?

For example, on this bit of documentation (https://developers.hubspot.com/docs/methods/companies/get-all-companies) it just includes a few optional parameters and not all those extra properties you mention, I will continue to look in the mean time.

Again, appreciate your time and help on this!

Thanks,
Toby

0 Upvotes