APIs & Integrations

ArieB
Member

Setting the current user as the owner using the API

We are using the OAuth2 API to create companies and contacts in hubspot. We use the PHP HubSpot API v3 SDK.

 

Is there a way to find out what the currently-logged-in-user is, or otherwise to automatically set the currently-logged-in-user as the owner of the records that are created?

 

thanks!

0 Upvotes
3 Replies 3
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Setting the current user as the owner using the API

Hi @ArieB 

 

You can get a list of Owners (HubSpot Users) to assign the contacts, but you can't see any login information.

 

Have fun

Mike

0 Upvotes
ArieB
Member

Setting the current user as the owner using the API

Hi @Mike_Eastwood!

 

Thanks! Yeah, I had found that endpoint. I was considering getting that list and comparing the emailaddresses against the emailaddress of the currently-logged-in-user on our side. But then I realized that there is no guarantee that a user of our platform, that uses OAuth2 to connect with their HubSpot account, is using the same email address on both platforms.

 

When I'm logging in directly on HubSpot, and create a contact or company, I'm automatically assigned as the owner. You'd think there was a way to do the same when I'm logged in through OAuth2, and create a contact or company through API calls.

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Setting the current user as the owner using the API

Just checked the Chat API (because it assigns based on HubSpot User Status) nothing in there either...

 

Good luck

Mike