Search for companies by domain name


#1

Im sending a POST request to https://api.hubapi.com/companies/v2/domains/google.com/companies?hapikey=xxxxxxxxxxxxxxxxxxxxxxxx
header
Content-Type = application/json
with a body of
{
"limit": 10,
"requestOptions": {
"properties": [
"domain",
"createdate",
"name",
"hs_lastmodifieddate"
]
},
"offset": {
"isPrimary": true,
"companyId": 0
}
}

I get nothing back. My key is good and the companies i've tested with exist and match the domain name in the company record.


#3

Hi @jeffgipson, making this request with the body you sent over to my own portal to a company who's domain name exists gives me back a proper response. When I make the request to a domain that doesn't exist, I get an empty response, so it could be that the company doesn't exist in your portal, but you said you confirmed this detail, so it may suggest another issue.

unspecified

Would you be able to provide me with your HubID so I can dig deeper into this?


#4

My hub is 2283631 yes I verified the company domain name is exactly the same


#5

hey @jeffgipson, using an internal REST client, I was able to use your portal ID to successfully POST to that endpoint and get a response back. I got one item in response, which looks correct as in your portal there's one company with the domain that exists as exactly "google.com". This points to the fact that there may be an issue with your network, REST client, or actual hapikey itself. Would it be okay if I got your hapikey through your integrations settings and tried making the request that way?

In the interim, I might suggest for you to try connecting to a different network, or trying another REST client. I elect to use Postman.


#6

I tried in postman already I got the same result my key is XXXXXXXX-XXXX-XXXX-XXXXXXXXX

Jeff Gipson
Recruiters Websites

O: (573) 837-1315 Ext 216

C: (314) 780-7995


#7

Hey @jeffgipson, I would refrain from posting your API key here since this is a public forum. It would be best to edit your message so that we can't see the full API key! I can grab the api key from your integrations settings so no need to post it here :slight_smile:

Thank you for the additional information. I'm going to be doing some testing and get back to you.


#8

Hi @jeffgipson, I just made a successful POST request using your Hapikey and the Google.com domain in the URL. I was having troubles earlier making the request, but then realized my header had an extra space at the end of Content-Type. I would double/triple check your header and make sure there's no typo there.

Your hapikey is good, and the request body is properly formatted so you should be good to go. If it doesn't work again, try using something other than postman, but I have a feeling this could be a simple issue with the header.


#9

I still cant get it to work can you share it from post man so I can compare the calls?