# Get Contacts at a Company method does not work

**URL:** <https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [September 10, 2019, 3:30pm UTC](https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178 "2019-09-10T15:30:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirko\_ds](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mirko_ds/32/35608_2.png) [@mirko\_ds](https://community.hubspot.com/u/mirko_ds)\
**Post date:** [September 10, 2019, 3:30pm UTC](https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178/1 "2019-09-10T15:30:33Z")

</div>

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/](https://app.hubspot.com/contacts/5930439/company/2233360699/)looks like this:

 ![Schermata 2019-09-10 alle 17.22.32.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/9/c9020ed14612e7e4b12d0068d31f9ccedbe3ccd0.png)

where [2233360699](https://app.hubspot.com/contacts/5930439/company/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](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

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 11, 2019, 6:25pm UTC](https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178/2 "2019-09-11T18:25:01Z")

</div>

Hi [@mirko\_ds](https://community.hubspot.com/t5/user/viewprofilepage/user-id/104774) ,

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](https://developers.hubspot.com/docs/methods/crm-associations/get-associations). 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.

---

<div class="post-metadata">

**Author:** ![mirko\_ds](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mirko_ds/32/35608_2.png) [@mirko\_ds](https://community.hubspot.com/u/mirko_ds)\
**Post date:** [September 12, 2019, 9:38am UTC](https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178/3 "2019-09-12T09:38:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 12, 2019, 5:20pm UTC](https://community.hubspot.com/t/get-contacts-at-a-company-method-does-not-work/16178/4 "2019-09-12T17:20:18Z")

</div>

Hey [@mirko\_ds](https://community.hubspot.com/t5/user/viewprofilepage/user-id/104774) ,

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: [HubSpot Developer Changelog](https://developers.hubspot.com/changelog)
