If the
Contact Owner
is an integer representing the ID of the contact owner in HubSpot, how can you match it against the corresponding name?
E.g. the contact owner is David, and the code reads this as having an ID of 2321, how can I make the code see that the associated name is David?
Hi @OBhatti,
You can use the Owners API. Then you can use the “/crm/v3/owners/{ownerId}” endpoint to get the details of a user. Here is an example response:
{
"id": "6166860",
"email": "jsmith@example.com",
"firstName": "John",
"lastName": "Smith",
"userId": 1296619,
"createdAt": "2019-10-30T03:30:17.883Z",
"updatedAt": "2019-12-07T16:50:06.678Z",
"archived": false,
"teams": [
{
"id": "178588",
"name": "West Coast Sales",
"primary": true
},
{
"id": "178590",
"name": "California Sales",
"primary": false
}
]
}
Remeber to specificy if you are getting the user via id or userID in the api, they are both integers representing the ID so you will need to see which one you have.
Best,