Re: How do you get the Company owner from the companies API

BrianM2
Membre

Hi,

 

I have extracted a list of owners, but would now like to see which owners are assigned to which companies. Is there a parameter on the companies API that will provide this information?

 

Thanks

 

 

 

0 Votes
1 Solution acceptée
MatthewShepherd
Solution
Conseiller clé

Hi @BrianM2 

If you use the Get all companies endpoint of the Companies API you can include the hubspot_owner_id property in the properties parameter as follows:

 

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

You then need to match this up to a list of your Hubspot owners.

 

Edit: In reading your question again, you may be looking for a way to just pull companies with a specific owner ID. I don't see a way to do this directly through one API request.

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.

Voir la solution dans l'envoi d'origine

11 Réponses 11
jarbot001
Contributeur

@mattv Is it still the case we can't pull a list of accounts by hubspot_owner_id?  It seem possible in the CRM v3 API using the companies/search endpoint.  I'm trying to use a filter to limit results but I haven't not successfully pulled a list yet.

0 Votes
jarbot001
Contributeur

Actually I have it working in API v3.  I was using user_id instead of the top secret owner_id. Users having 2 ids is very confusing to me. 

0 Votes
JNorverto
Membre

@jarbot001 Can you obtain a list of Companies by the owner_id? How did you do it? Can you help me with that?

Thanks!

 

MatthewShepherd
Solution
Conseiller clé

Hi @BrianM2 

If you use the Get all companies endpoint of the Companies API you can include the hubspot_owner_id property in the properties parameter as follows:

 

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

You then need to match this up to a list of your Hubspot owners.

 

Edit: In reading your question again, you may be looking for a way to just pull companies with a specific owner ID. I don't see a way to do this directly through one API request.

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
Dan_Potts
Membre

Is there any way to include the company owner data in the companies request to avoid another request and having to pair up the data?

0 Votes
MatthewShepherd
Conseiller clé

@Dan_Potts I don't believe so.

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

is returning the Hubspot owner, just not in a recognisable format (numeric ID). Hence the need to match Hubspot Owner ID to an owner name via a call to the  Hubpsot Owners Endpoint. 

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
0 Votes
Dan_Potts
Membre

Oh I see 😕 Thanks @MatthewShepherd for the answer!

 

Do you have an open feature request for the ability to include this data in the request, either as an `includes` parameter, or by config?

0 Votes
MatthewShepherd
Conseiller clé

Hi @Dan_Potts 

 

I don't see one in the ideas forum, but worth searching there to see if you can a similar feature request. If not feel free to submit your idea here: https://community.hubspot.com/t5/custom/page/page-id/ideaslandingpage

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
0 Votes
Dan_Potts
Membre

Awesome! Will do! Thanks again @MatthewShepherd !

0 Votes
BrianM2
Membre

Thanks,

 

That's exactly what I was looking for.

0 Votes
MatthewShepherd
Conseiller clé

@BrianM2 

Glad to hear it. If this answered your question, could you mark the answer above as a solution, please?

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
0 Votes