This gives me basic info of the comapnies. How do i get the primary contact associated with the company? I looked into properties= option but didn't find any property that indicates the contact details associated the company.
How to get contact associated to a company using APIs
SOLVE
If we're both talking about a Company to Contact Record within HubSpot then yes.
However, you could also create your own custom company properties that include the primary contact's information i.e. firstname, email, phone, etc. After you create those, you fill them out over the API, a workflow, or the UI when you create the company record. There are several ways to accomplish what you're looking for.
How to get contact associated to a company using APIs
SOLVE
If we're both talking about a Company to Contact Record within HubSpot then yes.
However, you could also create your own custom company properties that include the primary contact's information i.e. firstname, email, phone, etc. After you create those, you fill them out over the API, a workflow, or the UI when you create the company record. There are several ways to accomplish what you're looking for.
"List associations of a company by type" will get you the records associated with that company. GET /crm/v3/objects/companies/{companyId}/associations/{toObjectType}
"Associate a company with another object" will allow you to make the association to a contact. PUT /crm/v3/objects/companies/{companyId}/associations/{toObjectType}/{toObjectId}/{associationType}
Now, it seems i need to make one more call to get contact. So, 2 additional calls just to get contact. Further, 3 are returned and i don't know which one is main. Do i need to make call to each of these to find the info?
How to get contact associated to a company using APIs
SOLVE
Did you resolve the best way to get the primary contact for a company? I'm following down this same path now and it would be great if the company object had a "primary contact id" at least.