Aug 6, 2017 8:08 PM
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):
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):
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!
Aug 6, 2017 8:50 PM
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!
Aug 6, 2017 9:01 PM
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!
Jun 26, 2018 7:21 AM
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
Jul 6, 2018 1:54 PM
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
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!