How to get a contact's data by ID with the new APIs ?

SOLVE
LeKevoid
Contributor

Hi !

I think the question has been asked lots of time before, but the best documentation I can find only pertains to the old API...

 

I'd like to use a backend function to check the current visitor to our website (not hosted on Hubspot) using their hubspotutk cookie, and get some of their Hubspot properties so we can customize our content based on who they are.

 

My question is twofold :

1. Is there a reason why this would be a bad idea, security-wise or otherwise ?

2. Is there a way to do this ?

 

With the old API I could easily get what I wanted using the contact's VID, but I can't find the equivalent in the new one.

 

Thank you for your help !

0 Upvotes
1 Accepted solution

Accepted Solutions
dennisedson
Solution
Community Manager

@LeKevoid 

Presently, there is not an v3 equivelant which is why these v1 endpoints are still maintained and supported.  I was informed a couple days ago that the team is pushing to bridge the gap between the two.  In the interim, you should feel safe employing the v1 endpoint.

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content

View solution in original post

0 Upvotes
2 Replies 2
dennisedson
Solution
Community Manager

@LeKevoid 

Presently, there is not an v3 equivelant which is why these v1 endpoints are still maintained and supported.  I was informed a couple days ago that the team is pushing to bridge the gap between the two.  In the interim, you should feel safe employing the v1 endpoint.

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content

View solution in original post

0 Upvotes
webdew
Top Contributor | Diamond Partner

Hi @LeKevoid ,

Use below documentation to get contact from ID.
Link : https://legacydocs.hubspot.com/docs/methods/contacts/get_contact
Screen shot : https://prnt.sc/1g2uhww

Example GET URL:
https://api.hubapi.com/contacts/v1/contact/vid/<VID>/profile?hapikey=demo


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes