APIs & Integrations

bblatnick
Member

How to retrieve a contact's user token through Contacts API?

SOLVE

I have a contact’s vid and I wish to get the user token associated that contact record. What’s the best way to achieve this? The GET /contacts/v1/contact/vid/:contact_id/profile endpoint seems to not return the contact’s usertoken in the response.

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

How to retrieve a contact's user token through Contacts API?

SOLVE

Hey, @Kaitos You linked to the correct endpoint. Legacy endpoints are stable and supported. There is not a v3 equivalent of this specific endpoint. 

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

View solution in original post

0 Upvotes
10 Replies 10
Kaitos
Participant

How to retrieve a contact's user token through Contacts API?

SOLVE

The v1 docs made this possible. Is it still possible with the V3?


Docs: https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_utk

0 Upvotes
Jaycee_Lewis
Solution
Community Manager
Community Manager

How to retrieve a contact's user token through Contacts API?

SOLVE

Hey, @Kaitos You linked to the correct endpoint. Legacy endpoints are stable and supported. There is not a v3 equivalent of this specific endpoint. 

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to retrieve a contact's user token through Contacts API?

SOLVE

Hi @nflaherty,

There aren't any updates on this that I'm aware of. I can totally see the use case you're describing, though; If you have the inclination, I would encourage you to check out the Ideas Forum on the HubSpot Community. There, you can create a post including your use case that product and other customers can see.

0 Upvotes
arielledesma
Member

How to retrieve a contact's user token through Contacts API?

SOLVE

Has there been an update to this?

 

I have a ton of GA data with hubspotutk, and I want to get this data tied to our Hubspot dataset. 

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to retrieve a contact's user token through Contacts API?

SOLVE

Hi @bblatnick,

It's not currently possible to look up a contact's usertoken(s). The best method to identify known contacts is still to make a call to the 'Get a contact by usertoken' endpoint and look for the "is-contact" field.

nflaherty
Participant

How to retrieve a contact's user token through Contacts API?

SOLVE

Hi @Derek_Gervais, has anything changed with regard to looking up a contact's (or a batch of contacts') usertoken(s) programmatically?

Here is our use case: we would like to send a users' usertoken up to google analytics as the userid. Then, we'd like to pull hubspot contacts and google analytics page view and event data down into a data warehouse and associate the two. With this, we will know the complete visitor journey, and be able to map it all the way down the funnel past conversion.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

How to retrieve a contact's user token through Contacts API?

SOLVE

Hi @bblatnick

The usertokens (it’s possible for more than one token to be associated with a contact) don’t show up in the data for the contact, and we don’t currently have a way to look those up.

Can you tell me what you’d want to use the uerstoken for?

0 Upvotes
bblatnick
Member

How to retrieve a contact's user token through Contacts API?

SOLVE

I see. I want to identify known vs unknown Hubspot visitors coming to my website which means I’d need to know each contact’s user token or tokens. The API seems a bit misleading because the usertoken is returned as a property in http://developers.hubspot.com/docs/methods/contacts/get_contact_by_utk.

Is there any plans to be able to look up user tokens for contacts in the future?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

How to retrieve a contact's user token through Contacts API?

SOLVE

That endpoint won’t return the utk, it only uses the utk to look up a contact record. That endpoint actually sounds like it would do what you’re looking to do. When a visitor hits your site, you can grab the hubspotutk cookie (which gets created by the HubSpot tracking code) from that visitor, and then use that endpoint to see if there’s a contact associated with that cookie. If you get a 404, or a response that includes "is-contact": false then the cookie is not associated with a contact.

0 Upvotes
bblatnick
Member

How to retrieve a contact's user token through Contacts API?

SOLVE

Has anything changed in this regard? I know there has been some changes to the API since I asked this question last.