APIs & Integrations

KevinL33
Mitglied

Search for Companies by Domain returns Method Not Allowed

lösung

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 Upvotes
1 Akzeptierte Lösung
dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Search for Companies by Domain returns Method Not Allowed

lösung

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.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
7 Antworten
KevinL33
Mitglied

Search for Companies by Domain returns Method Not Allowed

lösung

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 Upvotes
KevinL33
Mitglied

Search for Companies by Domain returns Method Not Allowed

lösung

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 Upvotes
dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Search for Companies by Domain returns Method Not Allowed

lösung

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 Upvotes
KevinL33
Mitglied

Search for Companies by Domain returns Method Not Allowed

lösung

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
Mitglied

Search for Companies by Domain returns Method Not Allowed

lösung

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 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Search for Companies by Domain returns Method Not Allowed

lösung

@KevinL33 ,

I just tested in postman and it works for me 🤔

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

0 Upvotes
Teun
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Search for Companies by Domain returns Method Not Allowed

lösung

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.