How to identify diferent hubspot users from a CRM extension?

SOLVE
catalinsendsms
Participant

I need to make a CRM extension for my API, but I am cannot understand how to identify different HubSpot users. I was reading here and I found this line: 

catalinsendsms_0-1609748931043.png

Is the userId the same user_id I get when I call this (https://api.hubapi.com/oauth/v1/access-tokens/) endpoint?

0 Upvotes
1 Accepted solution

Accepted Solutions
jackcoldrick
Solution
HubSpot Employee

Hi @catalinsendsms,

 

Every Hubspot user has a "userID" and a "userEmail". These can be retrieved using the "Owners API". For instance when I'm using the CRM Extension with my own application and I load a record in the CRM I can see the following query string parameters:

 

 

&associatedObjectType=CONTACT
&portalId=7248615
&userEmail=jackcoldrick%40hubspot.com
&userId=3975103

 

 

If I make a GET request to "https://api.hubapi.com/owners/v2/owners"  (The Owners API) it returns:

 

 

 {
        "portalId": 7248615,
        "ownerId": 44782397,
        "type": "PERSON",
        "firstName": "Jack",
        "lastName": "Coldrick",
        "email": "jackcoldrick@hubspot.com",
        "createdAt": 1583193141650,
        "updatedAt": 1583919235737,
        "signature": "",
        "remoteList": [],
        "hasContactsAccess": false,
        "activeUserId": 3975103,
        "userIdIncludingInactive": 3975103,
        "isActive": true
    }

 

 

There is a lot of additional information in the response but the most important in your instance would be the "activeUserId" and "email". 

 

I hope this helps.

Jack

 

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn

View solution in original post

2 Replies 2
jackcoldrick
Solution
HubSpot Employee

Hi @catalinsendsms,

 

Every Hubspot user has a "userID" and a "userEmail". These can be retrieved using the "Owners API". For instance when I'm using the CRM Extension with my own application and I load a record in the CRM I can see the following query string parameters:

 

 

&associatedObjectType=CONTACT
&portalId=7248615
&userEmail=jackcoldrick%40hubspot.com
&userId=3975103

 

 

If I make a GET request to "https://api.hubapi.com/owners/v2/owners"  (The Owners API) it returns:

 

 

 {
        "portalId": 7248615,
        "ownerId": 44782397,
        "type": "PERSON",
        "firstName": "Jack",
        "lastName": "Coldrick",
        "email": "jackcoldrick@hubspot.com",
        "createdAt": 1583193141650,
        "updatedAt": 1583919235737,
        "signature": "",
        "remoteList": [],
        "hasContactsAccess": false,
        "activeUserId": 3975103,
        "userIdIncludingInactive": 3975103,
        "isActive": true
    }

 

 

There is a lot of additional information in the response but the most important in your instance would be the "activeUserId" and "email". 

 

I hope this helps.

Jack

 

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn

View solution in original post

catalinsendsms
Participant

I get the same information when the user clicks on an action button? @jackcoldrick

0 Upvotes