APIs & Integrations

coffeeocean
Participant

What is "remoteList" and "remoteId"? What is the ultimate identifier of an owner object?

When I use Owner api “/owners/v2/owners/”, I got an array of owner objects, one of them is below (values are scrambled for privacy purpose):
“18886483”: {
“portalId”: 12345,
“ownerId”: 18886483,
“type”: “PERSON”,
“firstName”: “first”,
“lastName”: “last”,
“email”: "example@gmail.com",
“createdAt”: 1485166307163,
“updatedAt”: 1500286261711,
“remoteList”: [
{
“id”: 16293237,
“portalId”: 12345,
“ownerId”: 18886483,
“remoteId”: “3828000”,
“remoteType”: “HUBSPOT”,
“active”: true
}
],
“hasContactsAccess”: false
},

When calling oauth api “/oauth/v1/access-tokens/:token”, I got the following about the current authenticased hubspot user (the same user above with the same email):
{
“token”: “CNbFztnbKxICAQEYkI2qASCk0ukBKNmvAjIZAEL7khOjrFMRVfHYEzGplShAO4D9AHZfjg”,
“user”: "example@gmail.com",
“hub_domain”: “www.example.com”,
“scopes”: [
“contacts”,
“oauth”
],
“hub_id”: 12345,
“app_id”: 54321,
“expires_in”: 21599,
“user_id”: 3828000,
“token_type”: “access”
}

The “user_id” matches the “remoteId” from the owners api, but “ownerId” doesn’t show up in the response from the oauth api. I’m confused, what is the ultimate ID that identifies a hubspot user and that it always remain the same value even when the user changes email address? What does “remoteList” and “remoteId” in owners api’s response mean? Thanks!

0 Upvotes
4 Replies 4
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

What is "remoteList" and "remoteId"? What is the ultimate identifier of an owner object?

Hi all,

There isn't currently any 'Users API'; it's used internally by the app but is inaccessible via the API (other than the presence of the user_id parameter when pulling OAuth token info). We don't have much in the way of documentation around remotes or users because it's not currently possible for integrators to interact with these entities.

I also wanted to touch on a key misconception here; there isn't currently any way to get info on 'logged in' users. The user_id parameter is unique to a HubSpot user, but pulling OAuth token information does not allow you to get info on user sessions or anything like that.

Happy to answer other specific questions here if needed!

0 Upvotes
andreasmischke
Member

What is "remoteList" and "remoteId"? What is the ultimate identifier of an owner object?

I stumbled upon the same question right now.
Thanks @coffeeocean for your first explanation. Helped me a lot.

Can anybody else verify this and give us a few more details about this mysterious user entity?

0 Upvotes
coffeeocean
Participant

What is "remoteList" and "remoteId"? What is the ultimate identifier of an owner object?

I can’t find much documentation about the “remoteList”, but from I can find and read so far, I have a vague understanding of it and would appreciate if someone could confirm or correct me.

Definition of a “user” is a logged in user in hubspot. It is only within hubspot. The “user_id” field returned by api “/oauth/v1/access-tokens/:token” is the unique identifier of it and it remains the same even when the hubspot user changes email address. So we can use this “user_id” as the ultimate identifier of a hubspot user.

Definition of a “remoteId” is about an actual entity (e.g., hubspot user, salesforce user) that an Owner wraps around. Owner object is an abstract layer, which could refer to either a hubspot user or salesforce user. “ownerId” is the unique identifier of this owner object. When the underlying actual object of this owner is a hubspot user, its “remoteId” would be the hubspot “user_id” mentioned above.

So to uniquely identify a logged in hubspot user, I should use “user” instead of “owner”. And “user_id” from the “/oauth/v1/access-tokens/:token” api is the unique identifier of “user”. I’m wondering where else in the hubspot api is this “user_id” used? I can’t seem to find an api to get a “user” object by its “user_id” (assuming the user is in my organization and I have permission to get user info). I needed to do this, and that is why I am trying to use “Owers” api to get metadata (e.g., email, first name, last name, etc.) of the currently logged in hubspot user (i.e., “myself”) as a workaround. Is there better way of achieving that?

I’m also wondering if salesforce user (who is mapped to an owner object in hubspot) can login to hubspot at all? Thanks!

0 Upvotes
coffeeocean
Participant

What is "remoteList" and "remoteId"? What is the ultimate identifier of an owner object?

One more thing I am also confused is what does it mean when “remoteList” has multiple objects in it? Is its semantic more like a group? For example, “2 hubspot users and 3 salesforce users are considered the same owner” kind of scenario? But then the “firstName” and “lastName” are on the “owner” object, what does it even mean if multiple users with different names are included in the “remoteList”? I really hope someone could refer me to some good documentation describing all these. I’m quite confused and can’t seem to find any good doc after searching around. Thanks!

0 Upvotes