Issue concerning creating a contact for a specific portal ID
Hi,
I’m creating an integration that saves contacts for a user logged by OAuth2.
The user is asked to login and give permissions for the integration and then my server is calling API endpoint to store a new contact.
The problem begins, when a user has access to many accounts with different HUB IDs. Is there any way to specify for which account the contact is going to be saved?
Issue concerning creating a contact for a specific portal ID
@pmanca thanks, but seems like I didn’t manage to explain myself, and I did forget to attach the screenshots.
The user has 2 accounts
xyz - where the user is a regular user (appear as the top account, see right image)
abc - where the user is an admin
The user start the OAuth, he gets the result of left image (the full message is You do not have the correct role to grant these permissions. Please contact your administrator.)
Then
The user choose the second account- you can see the result of it in the background of right image
The user press on the profile button at the top right right image
Now the user cannot complete the OAuth process. If it had succeeded, then we can do what you wrote in your answer
This is where they would choose their portal. My apologies If i’m still not following everything.
At one point do they get the first screen(left)? I would imagine it would happen after they see the screen I posted above right? Does that happen for every user or just some users?
Issue concerning creating a contact for a specific portal ID
Ok, I imagine the flow should be
Start the OAUth
Getting your screen, in case of multiple accounts
Getting the successful authentication if all good, or my left screen if there was a problem
I did this flow more than 10 times, I don’t remember seeing the screen you posted, but it might happened at the first time and I don’t remember.
We tried it with other accounts, but the top account was always the account the user was admin of. And I don’t remember we needed to choose the account then.
Issue concerning creating a contact for a specific portal ID
@nheimann1 A portal in my words would be an instance of HubSpot or from what it sounds like an account in your words. Here is a different way of me asking it. Does each of your accounts have a different HubSpot ID to them?
Issue concerning creating a contact for a specific portal ID
Thanks Peter.
I’ll explain a bit more about the issue we are having, Christopher and I are working on the same project.
We have an integration app an admin can add to their account.
The purpose of the app, is an option to send from the phone a contact and our server adds it to the Hubspot account.
Then, a user who is part of the account can add this integration by signing in via a webview (we are working on Android).
Then the user can pick any contact he has and send it to the CRM
All working well as long as the user is part of one hub account. If the users has multiple accounts the flow of the user is very broken while trying to sign in via the webview
The problems:
A. If the user has 2 accounts, and only the second having this integration, than we get a response that the user can’t proceed. I’ll send screenshots and the actual message tomorrow, sorry.
It seems that happen since hub spot try to link the user with the integration via the first hub account the user has (the top account the user has when clicking on the profile at the top right of the account.
Then let’s assume the user wants to continue, he choose the right account in hubspot, then this account opens in the contacts screen, and we didn’t see how to proceed
But this is quite a broken UX.
B. What happen if both account has the integration, will it associate it with the first account the or the second.
It seems that if you have the option to send the hub I’d, Tha. Both of this issues can be solved.
From the documentation, it seems that oAuth 2 doesn’t need it the id.
Is there a way of solve this UX?
Can we send the account I’d with the oAuth 2
Request?
Hope this will work
P.S.
This is a copy paste from the documentation
You no longer need to specify the Hub ID in the URL you send the user to to authorize your app. Users will have the ability to select which HubSpot account they want to authenticate on the HubSpot authentication screen.
Issue concerning creating a contact for a specific portal ID
@nheimann1 You will need to hold both access tokens in memory or in a DB. If you are on Android then you should have access to their SQL lite DB right?(I haven’t done android specific programming in a couple years) When they make the call back to hubspot you shoud know what portal they have picked and choose the right access token. We don’t require a portal ID because the access token itself is specific to a certain portal.
Christopher, i’m not sure I understand the full goal of your integration. At what point are they selecting multiple portals? Can you please expand upon your project please?