APIs & Integrations

Seekford
Member

hs_created_by_user_id How do I correlate to an actual user?

Use case is pretty simple.

 

I need to get a deal from HubSpot, and correlate that to a user in an external system. So, I have two choices that would be produce what I need.

1) Ability to correlate that to an email address

2) Ability to have the user tell me what their user id is.

 

The ID that field provides is NOT the id sitting under my user picture in my account. **bleep**, its even different than the hubspot_owner_id returned in the GetDeal call.

 

The ID's just dont correlate anywhere meaningfully.

 

Long story short. Want to call GetDeal and have it let me know who changed the deal, who owned the deal and the ability to correlate that to a user in an external system. (Email, or an ID the user can provide so we can tag them manually)

 

 

0 Upvotes
5 Replies 5
WendyGoh
HubSpot Employee
HubSpot Employee

hs_created_by_user_id How do I correlate to an actual user?

Hey @Seekford,

 

When using the Get a deal API, in the response body, the hubspot_owner_id property will return the deal owner's email under the sourceId key. Example:

 

        "hubspot_owner_id": {
            "value": "33xxxxx",
            "timestamp": 1577754506355,
            "source": "CRM_UI",
            "sourceId": "wxxxx@hubspot.com",
            "versions": [
                {
                    "name": "hubspot_owner_id",
                    "value": "33xxxxx",
                    "timestamp": 1577754506355,
                    "sourceId": "wxxxx@hubspot.com",
                    "source": "CRM_UI",
                    "sourceVid": []
                }
            ]
        }

In this case, the deal owner email is wxxxx@hubspot.com

 

Does this information helps you to correlate to the user in your team external system? Let me know if there's anything else you'd like to further clarify on. 

0 Upvotes
Seekford
Member

hs_created_by_user_id How do I correlate to an actual user?

@WendyGoh,

 

Turns out I also need to be able to identify the last user who modified the deal.

hs_updated_by_user_id: {
value: 9590231,
timestamp: 1579628872986,
source: CONTACTS,
sourceId: CRM_UI,
versions: [ ]
}

I can't find a single reference how to correlate. I called the Contacts api with this value and it doesnt return a record.

This is different than the Owner id. I am testing in an account with one user, so it's really weird HubSpot has all these different ID's to point to the same person.

Any ideas on how to correlate this?

 

 

 

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

hs_created_by_user_id How do I correlate to an actual user?

Hey @Seekford,

 

All these are great questions!

 

First thing first, the 'hubspot_owner_id' property returns the ownerId value whereas the 'hs_updated_by_user_id' property returns userId value. 

 

We surface ownerId in-app and you can locate them by: At the top right hand corner, click on the 'Settings' icon > At the left side panel, click on 'Properties' > Search for owner, click on 'Contact owner' > You will noticed that on the right side panel that hovered out, there's an internal value column. These values correlates to the value you retrieve via the - Get a list of owners endpoint.

 

On the other hand, HubSpot user IDs are usually not surfaced in-app and as mentioned by Isaac <here>

 

They're tied to a user's login identity and are returned in the activeUserId and remoteId fields from the Get owners endpoint. The only API applications I can think of for user IDs involve OAuth tokens and CRM Extensions

I hope this helps to further clarify things!

0 Upvotes
Seekford
Member

hs_created_by_user_id How do I correlate to an actual user?

@WendyGoh,

 

That helps shed a bit of light, but it makes it sound like there is no way to get who updated the deal last, just who owns it.

 

I created and updated a deal. So what I am seeing is the public for owner and the internal id for me since I am the one who changed the deal? Oddly inconsistent. 

 

Anyway, it would be great to be able to get who made the change so we can track that and use it to allow them to edit the records in our system.

 

Goal is to allow the owner to do things as well as anybody who has changed the record to do things. 

 

 

 

 

 

 

 

 

 

 

 

 

Seekford
Member

hs_created_by_user_id How do I correlate to an actual user?

Thank you. I really appreciate the quick response.  That does yield the email address.

 

In case my client needs to be able to point the user to their OwnerId that appears in that response, is there a way in the HubSpot UI to do so?

 

I foresee them asking me this and it would be nice to have in my pocket to be able to answer.

 

 

0 Upvotes