APIs & Integrations

Alvarocaste
Participant

How to build a contact URL depending user subdomain

SOLVE

Hi,

 

We are using the old API and we have seen that `profile-url` was deprecated, therefore we need to build the contact URL from ourselves having `vid` and `portal-id` (hub id).
https://app.hubspot.com/contacts/:hubid/contact/:vid

I've created an account to make some tests and I've realized that my subdomain is `app-eu1` (app-eu1.hubspot.com) so if I use https://app.hubspot.com/contacts/:hubid/contact/:vid doesn't redirect properly.


Is this something known? if yes, how do you deal with it?


We would need to build the URL depending on who you are (e.g. `app-ue1`, `app`, and so on)


Thanks

1 Accepted solution
jonathanhaber
Solution
HubSpot Product Team
HubSpot Product Team

How to build a contact URL depending user subdomain

SOLVE

Sorry for the delay here. There is an account-info API that we're still working on getting added to our API documentation. In the meantime you can hit this endpoint:

https://api.hubapi.com/account-info/v3/details

 

 The response will include a uiDomain field, such as app.hubspot.com or app-eu1.hubspot.com. This can be used to generate links into the HubSpot product. Let us know if you run into any issues

View solution in original post

6 Replies 6
jonathanhaber
Solution
HubSpot Product Team
HubSpot Product Team

How to build a contact URL depending user subdomain

SOLVE

Sorry for the delay here. There is an account-info API that we're still working on getting added to our API documentation. In the meantime you can hit this endpoint:

https://api.hubapi.com/account-info/v3/details

 

 The response will include a uiDomain field, such as app.hubspot.com or app-eu1.hubspot.com. This can be used to generate links into the HubSpot product. Let us know if you run into any issues

dennisedson
HubSpot Product Team
HubSpot Product Team

How to build a contact URL depending user subdomain

SOLVE

@Alvarocaste , I am asking around about this.  Will get back to you.

@himanshurauthan , while I wait for a reply, maybe you already have an answer 😀

himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

How to build a contact URL depending user subdomain

SOLVE

Hi @Alvarocaste,

 

Can you please share your steps, as this should work - https://app.hubspot.com/contacts/:hubid/contact/:vid

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
Alvarocaste
Participant

How to build a contact URL depending user subdomain

SOLVE

I think someone explained why this happens. Although I don't know yet how to solve it. I'd need to know how to know which region the user is in and then, build the URL according to that.

https://hubspotdev.slack.com/archives/C2YHAHB6K/p1628778644104200
Screenshot 2021-08-25 at 09.02.35.png

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to build a contact URL depending user subdomain

SOLVE

@Alvarocaste ,

I reported this to the team last week.  It is almost through development.  Believe a pull request has been made and we are waiting on it to be merged to prod.

There will also be some documentation added to the developer docs about this.  Not sure where or when, yet, but keep your eyes on the lookout 

Alvarocaste
Participant

How to build a contact URL depending user subdomain

SOLVE

Thanks @dennisedson!

0 Upvotes