APIs & Integrations

Noob
Miembro

I can't see Deal associations through API

resolver

Hello,

 

I'm trying to map 'owner' information to each deal.

 

I simply copy & pasted python code from API document page, and added "'associations' : True" to get associations data as below.

 

upload.PNG

 

But I got nothing but 'None' for associations as a result.

When I exported deals data in spreadsheet format, I could see some relevant fields such as deal owner.

Why I can't extract associations through API in this case..?

Am I missing to set something here?

 

Thank you so much.

 

0 Me gusta
1 Soluciones aceptada
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

I can't see Deal associations through API

resolver

Welcome, @Noob.

 

Happy to clarify.

 

The Get all deals endpoint will return associations if you append includeAssociations=true to the request URL. associations=true is invalid.

 

Here's the example I used:

https://api.hubspot.com/deals/v1/deal/paged?includeAssociations=true

 

I should also note that the deal owner is not stored as an association, but in the deal property hubspot_owner_id. Owners are referenced by ID, so you will need to use this Owners API endpoint to match them with their names or email addresses.

 

Thus, if you want to retrieve the deal owner and associations to contacts, companies, and tickets, use:

https://api.hubspot.com/deals/v1/deal/paged?includeAssociations=true&properties=hubspot_owner_id

Isaac Takushi

Associate Certification Manager

Ver la solución en mensaje original publicado

2 Respuestas 2
Noob
Miembro

I can't see Deal associations through API

resolver

When I connected 'recently created deals' API, I could fully see the associations information.

 

Is it that Hubspot does not support associations information for 'get all deals' API?

0 Me gusta
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

I can't see Deal associations through API

resolver

Welcome, @Noob.

 

Happy to clarify.

 

The Get all deals endpoint will return associations if you append includeAssociations=true to the request URL. associations=true is invalid.

 

Here's the example I used:

https://api.hubspot.com/deals/v1/deal/paged?includeAssociations=true

 

I should also note that the deal owner is not stored as an association, but in the deal property hubspot_owner_id. Owners are referenced by ID, so you will need to use this Owners API endpoint to match them with their names or email addresses.

 

Thus, if you want to retrieve the deal owner and associations to contacts, companies, and tickets, use:

https://api.hubspot.com/deals/v1/deal/paged?includeAssociations=true&properties=hubspot_owner_id

Isaac Takushi

Associate Certification Manager