APIs & Integrations

mirko_ds
Miembro

Get Contacts at a Company method does not work

resolver

Hi support,

 

I'm working with the hubspot API and I'm having some problems.

 

I'd like to fetch contacts associated to a company starting from the compony id.

 

The company page at url https://app.hubspot.com/contacts/5930439/company/2233360699/ looks like this:

Schermata 2019-09-10 alle 17.22.32.png

 

where 2233360699 is the id of the company.

 

To reach my goal of having contacts related to the company (basically I want to have the contact on the right bar) I'm using this method API https://api.hubapi.com/companies/v2/companies/2233360699/contacts?hapikey=MYSECRET but the list of the contacts is empty.

 

Why?  What am I doing wrong?

 

Thanks

 

0 Me gusta
1 Soluciones aceptada
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Get Contacts at a Company method does not work

resolver

Hey @mirko_ds ,

 

Ah, make sense, that's a common pitfall. Thanks for coming back to post your solution!

 

Also, this endpoint is currently deprecated, but will continue to be supported in its current form for a while. I don't have any definite timeframe for when it will be fully sunset, but we'll communicate the change on the Developer Changelog before we do: https://developers.hubspot.com/changelog

Ver la solución en mensaje original publicado

0 Me gusta
3 Respuestas 3
Derek_Gervais
Exmiembro de HubSpot
Exmiembro de HubSpot

Get Contacts at a Company method does not work

resolver

Hi @mirko_ds ,

 

Can you give me the raw response you get from HubSpot? I'm able to see the associated contact vids when making that same request to your portal, so I'm not quite sure what's going on.

 

Also, quick side note: While that endpoint technically still works, it's been deprecated in favor of the more robust Associations API. I'm happy to help figure out what's going on with the endpoint you're using, but I'd also recommend switching to the Associations API whenever possible.

0 Me gusta
mirko_ds
Miembro

Get Contacts at a Company method does not work

resolver

Hi Derek,

 

sorry it was my fault because i was using the apikey of another hubspot account.

 

So basically this endpoint will be deprecated soon? 

 

Thanks

 

0 Me gusta
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Get Contacts at a Company method does not work

resolver

Hey @mirko_ds ,

 

Ah, make sense, that's a common pitfall. Thanks for coming back to post your solution!

 

Also, this endpoint is currently deprecated, but will continue to be supported in its current form for a while. I don't have any definite timeframe for when it will be fully sunset, but we'll communicate the change on the Developer Changelog before we do: https://developers.hubspot.com/changelog

0 Me gusta