APIs & Integrations

KevinL33
Miembro

Search for Companies by Domain returns Method Not Allowed

resolver

HI all, I'm trying to use the function Search For Companies by domain, documented here:

https://legacydocs.hubspot.com/docs/methods/companies/search_companies_by_domain

 

But I always receive:

HTTP Error 405 

Method Not Allowed.

 

Has the function been deprecated? If so is there a current replacement for it?

 

Kevin.

0 Me gusta
1 Soluciones aceptada
dennisedson
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Search for Companies by Domain returns Method Not Allowed

resolver

ah, 

That would be expected then.

2 problems:

1.  you need to use your hapikey to get results specific for your portal

2.  the browser can only make get requests where this endpoint requires a post request. 

You can download postman or an equivalent to test this.

Ver la solución en mensaje original publicado

0 Me gusta
7 Respuestas 7
KevinL33
Miembro

Search for Companies by Domain returns Method Not Allowed

resolver

Hi @dennisedson I post the url from the demo, or I can put in one of our client contact domains with my apikey and get the same result

 

https://api.hubapi.com/companies/v2/domains/hubspot.com/companies?hapikey=demo


0 Me gusta
KevinL33
Miembro

Search for Companies by Domain returns Method Not Allowed

resolver

I should mention that I'm entering the url on a web browser and just viewing the Json that's returned ( if it's returned).

 

0 Me gusta
dennisedson
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Search for Companies by Domain returns Method Not Allowed

resolver

ah, 

That would be expected then.

2 problems:

1.  you need to use your hapikey to get results specific for your portal

2.  the browser can only make get requests where this endpoint requires a post request. 

You can download postman or an equivalent to test this.

0 Me gusta
KevinL33
Miembro

Search for Companies by Domain returns Method Not Allowed

resolver

Thanks for the info @dennisedson .  I actually installed the c# package HubSpot.NET and used the functions api.Company.GetByDomain() and api.Company.GetById().  Both work like a charm. Thanks again.  KL.

KevinL33
Miembro

Search for Companies by Domain returns Method Not Allowed

resolver

Hi @Teun   I am using an API key, the demo example doesn't even work.  If you follow my link and copy/paste the example URL you'll see the same error.

 

0 Me gusta
dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Search for Companies by Domain returns Method Not Allowed

resolver

@KevinL33 ,

I just tested in postman and it works for me 🤔

Can you post exactly what you are sending? (minus your hapikey)

0 Me gusta
Teun
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Search for Companies by Domain returns Method Not Allowed

resolver

Hi @KevinL33 ,

 

Do you use oAuth2 or the API key? If you use oAuth2, check if you have the correct scopes (contacts) in place. 



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.