# Fetch the contact ID

**URL:** <https://community.hubspot.com/t/fetch-the-contact-id/73491>\
**Category:** APIs & Integrations\
**Tags:** crm, contacts\
**Created:** [January 23, 2023, 1:14pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491 "2023-01-23T13:14:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PSharma92](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@PSharma92](https://community.hubspot.com/u/PSharma92)\
**Post date:** [January 23, 2023, 1:14pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/1 "2023-01-23T13:14:13Z")

</div>

Hello All,

I am currently working with hubspot’s contacts API and I want to check how to fetch/get contact ID via API (and not doing it manually) for a particular contact using property like phone number. If the anwer is yes, please share some suggestions.

Also please see the below json data that I am currently using:

{

“filterGroups”:[

{

“filters”:[

{

“propertyName”: “phonenumber”,

“operator”: “EQ”,

“value”:“+491xxxxxxxxxx”

}

]

}

]

}

And url that I am using is: " [https://api.hubapi.com/crm/v3/objects/contacts/search](https://api.hubapi.com/crm/v3/objects/contacts/search) "

Thank you and be safe.

Best,

Priyanka Sharma

---

<div class="post-metadata">

**Author:** ![Phil\_Vallender](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/phil_vallender/32/48924_2.png) [@Phil\_Vallender](https://community.hubspot.com/u/Phil_Vallender)\
**Post date:** [January 23, 2023, 1:28pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/2 "2023-01-23T13:28:51Z")

</div>

Hi @PSharma92

HubSpot’s default contact object has the property name ‘phone’ instead of ‘phonenumber’ - is this the issue with your current code?

Hope this helps?

---

<div class="post-metadata">

**Author:** ![PSharma92](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@PSharma92](https://community.hubspot.com/u/PSharma92)\
**Post date:** [January 23, 2023, 1:37pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/3 "2023-01-23T13:37:03Z")

</div>

Hi [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74) .

Thank you for your response. I just replaced phone number with phone and it’s still showing the following error responses :

For GET request, I am getting the error meesage: " Error 405 Method Not Allowed "  
For POST request, I am getting the error message: " Object not found /objectId are usually numeric. "

Thank you,

Best,

Priyanka Sharma

---

<div class="post-metadata">

**Author:** ![Phil\_Vallender](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/phil_vallender/32/48924_2.png) [@Phil\_Vallender](https://community.hubspot.com/u/Phil_Vallender)\
**Post date:** [January 23, 2023, 3:10pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/4 "2023-01-23T15:10:06Z")

</div>

Hi @PSharma92

Try [https://api.hubapi.com/contacts/v1/search/query](https://api.hubapi.com/contacts/v1/search/query) instead.

Are you refferring to legacy docs by the way? There is an updated API documentation which may help you: [https://developers.hubspot.com/docs/api/crm/contacts](https://developers.hubspot.com/docs/api/crm/contacts)

---

<div class="post-metadata">

**Author:** ![PSharma92](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@PSharma92](https://community.hubspot.com/u/PSharma92)\
**Post date:** [January 23, 2023, 4:52pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/5 "2023-01-23T16:52:26Z")

</div>

Hello [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74) again.

I am indeed following the updated documentation only. Can you please have a look at the below screenshot and if you can help me out with what would be the values for the parameters like “query”, “sorts” and “properties”.

 ![PSharma92_0-1674492723131.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/c/5c261ec8c245636703630d0223c6dd51e7791044.png)

Thank you,

Best,

Priyanka Sharma

---

<div class="post-metadata">

**Author:** ![PSharma92](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@PSharma92](https://community.hubspot.com/u/PSharma92)\
**Post date:** [January 23, 2023, 4:27pm UTC](https://community.hubspot.com/t/fetch-the-contact-id/73491/6 "2023-01-23T16:27:02Z")

</div>

Hello again [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74)

I am following the updated API documentation only. Can you please have a look on the below screenshot and if you can help me out with what would be the values of the parameters like “query”, “sorts” and “properties”

 ![PSharma92_0-1674492723131.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/c/5c261ec8c245636703630d0223c6dd51e7791044.png)

Thank you again for your quick responses 🙂

Best,

Priyanka Sharma
