User id vs owner id


#1

when I get the token information I get the following information: https://api.hubapi.com/oauth/v1/access-tokens

"user_id": 627388

when I lookup a deal using the REST API: https://api.hubapi.com/deals/v1/deal/260158844

"hubspot_owner_id": {
"versions": [
{
"name": "hubspot_owner_id",
"value": "66"

How do I link the 2 together, is there way to use the user id and get the owner id or use the owner id and get the user id? please help, as we trying to launch our software and we are stuck.
thanks

-Dileepa


#2

@Dileepa_Wijayanayake At the moment there is not a way to do this. I would be curious to hear why you would be trying to sync up the user that installed the app into the portal and the owner of a deal?


#3

so here's what happens in order:
-user authenticates, gets token, we record the user, i mean the user_id value in our side
-in our software user_id maps to our user some GUID
-when a deal is created, we get the owner id and try to look for that user in our software, and we cannot find the user

Maybe what we need to do is, instead of storing user_id, maybe we should store owner_id mapping to our user. but need to know how to take the user id and convert that to owner id?

The reason for above is, if the user who auths/gets the token, creates a new deal, we need to find that user who created the deal in our software. Thanks

-Dileepa


#4

@Dileepa_Wijayanayake What about the case where someone creates a deal and did not auth/gets the token? Do you log that too somehow? If so how?

You could also associate user_id to owner_id by the email address. Both endpoints return the email address of the user.


#5

We ended up getting the owner list and finding the user from that. there was no direct api call to get a user using the owner id or the remote id.