APIs & Integrations

brianmelanson
Participant

Contacts Fields in API

SOLVE

Hi Team,

 

We want to fetch these columns information in contact API.

 

API is: 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&count=2

And We need these columns

 

First Name
Last Name
Create Date
Company Name
Email
Job title
Message
Lead Status
Lead Stage
Lead Rating
Lifecycle Stage
Contact Owner
City
Country
Website URL
Phone Number
Hubspot Team
Domain Value
Original Source
Original source drill-down 1
 

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Contacts Fields in API

SOLVE

Hi, all.

 

Apologies for the delayed response.

 

At this time, team data is not surfaced via the Owners API. Currently, the only way to view team labels and IDs is in app by navigating to SettingsPropertiesContact properties > HubSpot team > Edit. See the screenshot below:

 

Team labels and IDs.jpg

That said, we are working to add team support to the Owners API and expect changes to be released to developer preview in early 2020.

 

If you are beta-tolerant, willing to give active feedback, and agree to HubSpot's Developer Beta Terms, direct message me with your Hub ID and email and I will work to get you added to the private beta with this feature.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
12 Replies 12
DaniellePeters
Top Contributor

Contacts Fields in API

SOLVE

Hey there!

 

If you take a look at the doc, you'll see that you can include the property parameter in the request to get back the desired properties. You can add it multiple times to get the properties you need. An example of a request that would return the First Name and Email:

 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&count=2&property=firstname&property=email

 

Documentation

https://developers.hubspot.com/docs/methods/contacts/get_contacts

brianmelanson
Participant

Contacts Fields in API

SOLVE

Hi Team,

 

Thanks for replying , really this is very helpfull for us, still we have query regarding these fields.

1. Lead Stage: how can we find out this in all contacts API

2. Contact Owner: we are getting Contact Owner Id in contacts API but we would to get contact owner name.

 

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Contacts Fields in API

SOLVE

Thanks for jumping in, @DaniellePeters! (Hi, by the way Smiley Very Happy)

 

@brianmelanson, let's see if I can help out here:

  1. Are you referring to the default contact property "Lead status" (hs_lead_status)? If so, as Danielle said, you can include the parameter property=hs_lead_status in your request URL. HubSpot will include the contact's value for this property if it exists. This method also works for the Get all contacts endpoint.
  2. You'll have to cross-reference the ownerId values with those returned from the Owners API, which does include names.

Isaac Takushi

Associate Certification Manager
brianmelanson
Participant

Contacts Fields in API

SOLVE

Hi Team,

 

I need one more things.

Hubspot Team: we are getting Hubspot Team Id in contacts API but we would to get Hubspot Team name, please help us to get the name of Hubspot Team.

 

Thanks

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Contacts Fields in API

SOLVE

Hi, @brianmelanson.

 

I'm not familiar with that parameter. Could you share some example contact JSON which shows the "HubSpot team ID" and the endpoint URL you retrieved it from? (Please do not include your API key.)

 

At this time, it's currently not possible to get team information through the Owners API; this information can only be found in the UI. Per this related discussion, I recognize this is a pain point.

 

If you would like to see team information returned via the Owners API, please upvote and comment on this feature request. I've already upvoted it.

Isaac Takushi

Associate Certification Manager
0 Upvotes
brianmelanson
Participant

Contacts Fields in API

SOLVE

Hi Team,

 

Please get the sample contacts JSON and request api url..

Request URL

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=67677-565656-dfffk-3434&count=1&pr...

 

Reponse JSON

{
"contacts": [
{
"addedAt": 1511811772905,
"vid": 565,
"canonical-vid": 345,
"merged-vids": [],
"portal-id": ,
"is-contact": true,
"profile-token": "",
"profile-url": "https://app.hubspot.com/contacts/4064021/contact/351",
"properties": {
"hubspot_team_id": {
"value": "58199"
},
"hs_predictivecontactscorebucket": {
"value": "bucket_3"
},
"firstname": {
"value": "Barbara"
},
"hubspot_owner_id": {
"value": "344545"
},
"jobtitle": {
"value": "Senior Vice President, Marketing"
},
"hs_analytics_source": {
"value": "OFFLINE"
},
"phone": {
"value": ""
},
"lastmodifieddate": {
"value": "1549905623970"
},
"hs_lead_status": {
"value": "Contacted"
},
"company": {
"value": ""
},
"lifecyclestage": {
"value": "opportunity"
},
"email": {
"value": ""
},
"lastname": {
"value": "ffgh"
}
},
"form-submissions": [],
"identity-profiles": [
{
"vid": 351,
"saved-at-timestamp": 1511811772765,
"deleted-changed-timestamp": 0,
"identities": [
{
"type": "EMAIL",
"value": "test@test.com",
"timestamp": 1511811772756,
"is-primary": true
},
{
"type": "LEAD_GUID",
"value": "0720c201-326e-4411-818e-34354rgrrt23",
"timestamp": 1511811772759
}
]
}
],
"merge-audits": []
}
],
"has-more": true,
"vid-offset": 351
}

 

In reponse JSON we are getting numeric value of hubspot_team_id, we need name of it.

 

Thanks

0 Upvotes
brianmelanson
Participant

Contacts Fields in API

SOLVE

Hi Team,

 

Can we get any solution about this requirement?

 

Thanks

Pramod

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Contacts Fields in API

SOLVE

Hey, @brianmelanson.

 

Apologies for the delayed response. I missed your question coming in. For the fastest response, please tag the user you are asking (e.g. @IsaacTakushi) so that we receive a notification.

 

Thanks for clarifying. The labels and option IDs for the hubspot_team_id property can be viewed here.

 

You should also be able to pull the team labels and option IDs by using this endpoint, specifically:

 

https://api.hubapi.com/properties/v1/contacts/properties/named/hubspot_team_id

 

However, I'm currently not seeing anything returned in the options array, unlike other dropdown-type properties I've tested. I'll look into this, but as I said, the same data is visible in-app here.

Isaac Takushi

Associate Certification Manager
0 Upvotes
viktoratfunnel
Member

Contacts Fields in API

SOLVE

Hi @IsaacTakushi,

 

We have the same problem as Brian. I have tried  your suggested endpoint: https://api.hubapi.com/properties/v1/contacts/properties/named/hubspot_team_id but I get an empty options array as well.

 

Is there any way we could get Hubspot team labels from the API? We ran into the same issue with Owner Ids but we were able to solve it by mapping the Ids with the response from this endpoint https://developers.hubspot.com/docs/methods/owners/get_owners.

 

Best regards, 

Viktor, Developer @ Funnel

0 Upvotes
Richard_Wein
Member

Contacts Fields in API

SOLVE

Hello. I've just come across the same problem. The Get A Deal endpoint returns Team IDs in fields like "hubspot_team_id" and "hs_all_team_ids", but I have no way of getting the corresponding team labels to display to my users.

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Contacts Fields in API

SOLVE

Hi, all.

 

Apologies for the delayed response.

 

At this time, team data is not surfaced via the Owners API. Currently, the only way to view team labels and IDs is in app by navigating to SettingsPropertiesContact properties > HubSpot team > Edit. See the screenshot below:

 

Team labels and IDs.jpg

That said, we are working to add team support to the Owners API and expect changes to be released to developer preview in early 2020.

 

If you are beta-tolerant, willing to give active feedback, and agree to HubSpot's Developer Beta Terms, direct message me with your Hub ID and email and I will work to get you added to the private beta with this feature.

Isaac Takushi

Associate Certification Manager
0 Upvotes
oswaldobiolo
Member

Contacts Fields in API

SOLVE

Hi guys.

 

As Isaac said above, today this in possible in v3 api.

https://developers.hubspot.com/docs/api/crm/owners

Below json response with object teams

{
  "results": [
    {
      "firstName": "John",
      "lastName": "Smith",
      "createdAt": "2019-10-30T03:30:17.883Z",
      "archived": false,
      "teams": [
        {
          "id": "178588",
          "name": "West Coast Sales"
        }
      ],
      "id": "6166860",
      "userId": 1296619,
      "email": "jsmith@example.com",
      "updatedAt": "2019-12-07T16:50:06.678Z"
    }
  ],
  "paging": {
    "next": {
      "after": "string",
      "link": "string"
    }
  }
}

I hope this helps you.