Aug 12, 2020 11:59 PM
Aug 17, 2020 9:47 PM
Just to clarify, by identifying the source of the tenant, do you mean the source of the contact creation? Or source of where that app was installed?
Additionally, could you expand further on what do you mean by multi tenant? Does it mean this?
In a multi-tenant environment, each customer shares the software application along with a single database, so multiple people from the same company can access the database. Still, even in multi-tenant, each tenant is isolated from other tenants.
Oct 19, 2020 12:20 PM
Oct 21, 2020 1:17 AM
Just to confirm, when you said click on "Make Awesome Deal" button, are you referring to the CRM extension action button?
If so, the action hook will have the following query parameters:
userId: The numeric userId of the customer requesting data.
userEmail: The user address, in HubSpot, of the user requesting data.
associatedObjectId: The ID for the current object, depending on the
associatedObjectType. This will be the
associatedObjectType: The type of object the user is requesting data about (
portalId: The portal ID (also called Hub ID) of the customer that is requesting data. This will be a customer that has installed your integration.
associatedObjectProperties. If one of the request properties is not defined for the current object, it will not be listed in the query string. In the above example, the company property
In this case, the portalId value would be the parameters that your team can look at when differetiating two different portals.
Oct 21, 2020 8:35 PM
Yes, an action button is what I am talking about, thank you. Yes, I wrote the lamdba to flip on the portalId but that's a total hack. I have to manually save the mapping from the portalId to the refresh_token. The only way I know the mapping is because I know exactly when I installed my app in my two HS instances and I dig through the logs (normally you shouldn't log a token).
This could be solved if HubSpot sends the portalId with the access_token+refresh_token response during install. OAuth installs an app into a portal, an HS instance, of course HS should send back to the app which portal/instance it just got installed into,access_token+refresh_token+portalId makes sense.
A domain would be useful as well, but I do not get any fields with "domain" in the name even when I add it to the &properties list. Nor is there a "domain" returned for the list of properties for a Deal. Is domain an HS-internal property? Do you mean use the user's email domain? There's no guarantee that the installer and the user have the same email. The installer could be like me - a contractor who doesn't even share the domain of the install's org. That's not usable. Anyway, there's no "domain" in the response of the refresh_token either so there's nothing tie domain to refresh_token just like there's nothing to tie portalId to refresh token.
There's another path ... in the Auth redirect I can send any content I want. I just send "Installation successful". I could ask the user for their portalId and get the contacts with the most recent refresh tokens and see if it works as validation (in case anyone is thinking of implementing this you must also send a secret with that page that is later verified on the server when the user's submits the form. Don't send the refresh key as the secret, make a new one.). Someone else has worked this out already, yeah?
Oct 22, 2020 2:35 AM
Mike, I like these suggestions. Alternatively being able to register multiple urls per HS portal could add the domain/tenant/customer/identifier for multi tenant environments to process. I am really surprised that HS is this early in their readiness of integration.
Nov 23, 2020 9:38 PM
In the meantime, will add a few more community members to the conversation to see if they have explored this before
|We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!|
Sign up today!
Nov 24, 2020 8:06 AM
Sorry for the delay, HubSpot resources gave me the answer last week.
First make the call to Refresh Token Information from the refresh token from the install:
Then know the secret that "hub_id" in the response is really the portal id the app was installed on. That should do most tricks.
I'm still confused on the difference between apps like HubSpot Community that every user installs (thus each user has their own refresh token) and apps that are just installed by a system/admin user on whom all the work is done on behalf of.