Creating a new company via API works fine, but initial return company name is empty
resolver
Hi all
I've been seeing this problem fairly regularly when creating new companies via API. I add the domain name (and HS fills in the rest upon creation)... that works fine, but the company object returned from the POST usually doesn't have any of the HS-filled properties filled in (e.g., Name). I have to re-query to get them. BTW, the new company ID comes back every time as expected.
The result should return some basic properties like: name, phone, state et cetera. BUT - you will only get back properties for properties you actually added in your post.
Since you only post the URL (domain name) the company actually does not have a name when you created it - it only has an ID and an URL.
Once the company is created (and you already got your first response) hubspot may add company information based on the URL. But this step does not happend upon creation. It happens a millisecond after you created the company and got your first response.
So - to shortly answer your question: Yes, you are correct. You have to make a second GET request with the ID to get the company data.
You
Hubspot
Data from third pary (where HS get data through url). It might also be located within hubspots own database.
1. Creating company > (request)
< 2. Company Created (response)
3. Request company data > (request)
< 4. Company name and data (response)
What you want to have:
1. Creating company --> (request)
2. Creating company
3. Request company data by URL > (request)
< 4. Company name and data (response)
< 5. Company Created (response) with data.
I would say that its very unlikely to get what you want in this case. You simply have to make a second call and hope that hubspot has completed step 3 and 4 in time.
Creating a new company via API works fine, but initial return company name is empty
resolver
Ok, cool. Odd that there isn't a 202 response, which can then let the requestor know it's in process. I don't send the name (and other fields) since that would imply to HS that I want my name to be whatever I send (even if blank).
Easy enough tho... simple re-query will do the trick.
The result should return some basic properties like: name, phone, state et cetera. BUT - you will only get back properties for properties you actually added in your post.
Since you only post the URL (domain name) the company actually does not have a name when you created it - it only has an ID and an URL.
Once the company is created (and you already got your first response) hubspot may add company information based on the URL. But this step does not happend upon creation. It happens a millisecond after you created the company and got your first response.
So - to shortly answer your question: Yes, you are correct. You have to make a second GET request with the ID to get the company data.
You
Hubspot
Data from third pary (where HS get data through url). It might also be located within hubspots own database.
1. Creating company > (request)
< 2. Company Created (response)
3. Request company data > (request)
< 4. Company name and data (response)
What you want to have:
1. Creating company --> (request)
2. Creating company
3. Request company data by URL > (request)
< 4. Company name and data (response)
< 5. Company Created (response) with data.
I would say that its very unlikely to get what you want in this case. You simply have to make a second call and hope that hubspot has completed step 3 and 4 in time.