APIs & Integrations

Arun1231
Member

Retrieve phone number from contacts

I have got a task of retrieve all phone numbers from the contact list . Is it possible through 

calling contact list api and contact by id api.

if i have to get only phone numbers and contact name from the list,is it possible if the list is large by calling api.? I don't want to import the contacts to the excel.

0 Upvotes
1 Reply 1
lscanlan
HubSpot Alumni
HubSpot Alumni

Retrieve phone number from contacts

Hi @Arun1231,

 

If you're trying to get contact names and phone numbers from contacts on a list, I think you'll want to use the endpoint documented here: https://developers.hubspot.com/docs/methods/lists/get_list_contacts, which is for getting contacts in a list.

 

You'll find the list ID in the URL of the list in HubSpot. Plug that into the request URL for :list_id . And then you can include which contact properties you want return as query string parameters. You can keep adding &property= and then the property name. So in your case, that might look something like:

 

https://api.hubapi.com/contacts/v1/lists/:list_id/contacts/all?hapikey=demo&property=phone&property=...

 

That will return the contacts in the list, along with their names and phone numbers.

 

Let me know if that's what you're looking for.

 

 - Leland

Leland Scanlan

HubSpot Developer Support
0 Upvotes