Created a new company:
curl https://api.intercom.io/companies\
-X POST \
-H 'Authorization:Bearer <AuthToken>' \
-H 'Accept: application/json' \
-H 'Content-Type:application/json' -d '
{
"name": "Test Company",
"company_id": "18ac530",
}'
It was created successfully.
Then used the Intercom generated id for it to attach it to a contact:
$ curl https://api.intercom.io/contacts/62fe23da8c9c889b4c86b884/companies\
-X POST \
-H 'Authorization:Bearer <AuthToken>' \
-H 'Accept:application/json' -d '{
"id": <intercom_id for the company>
}'
Got an error, company not found.
The docs say that a company must have at least 1 user to be listed and accessible. But this is a Catch-22 how am I supposed to add users if I am unable to access the company.
To confirm, that my initial call to create the company was indeed successful, I ran this:
curl \
-s https://api.intercom.io/companies?company_id=18ac530\
-H 'Authorization:Bearer <AuthToken>' \
-H "Accept:application/json"
It was successful, so the company was indeed created it just isn't accessible because it doesn't have any users. How do I add users/contacts?
https://developers.intercom.com/intercom-api-reference/reference/company-model