company property not returned when searching contacts
SOLVE
We've been using API Endpoint /contacts/v1/search/query to search our contacts, but despite the example in the documentation, the contact details do not contain the 'company' property with their associated company's name even when using '&property=company' specifically.
To then pull the company name we can then poll /companies/v2/companies/{companyid} as the contact details do include 'associatedcompanyid', but this is a time consuming operation and will use a lot of requests depending on the number of results.
I notice that it's possible do a batch request of contact IDs in a single request (/contacts/v1/contact/vids/batch), but not companies.
Is there a better way to get a given contact's associated company name when searching for contacts?
The Company Name value is referred to as company when referencing the response from this endpoint. We should not be seeing 2 values i.e company_name and company as the former is the label for the internal value company.
Also, you're correct with your observations, this is indeed a user-entered text field rather than an automated field that is associated to the Company Record.
This means that if you're looking to identify the Associated Company you'll need to work with the associatedcompanyid and then fetch the name via the Get Company by ID endpoint found here.
company property not returned when searching contacts
SOLVE
Thanks for the help Matthew.
I think what we'll do is programatically go through and add custom property for quick referencing a contact's company name or cache the companyid's name on our end to avoid an API call per search result once we're migrated over.
As you can see, we should see the Company parameter returned in the response when making this request.
If you're not seeing this can you provide me with an example request you're making where you're not seeing this being returned and we can take a look for you.
Could the way the data was uploaded originally have affected how this property works? It was done by a third party company who I'm waiting to hear back from regarding this.
I was able to fine the cause of this one for the contact we're referring to in this request. If we take a look at the Contact Record, we can see that the property Company Name is the property for the internal value company.
If we check this record, we can see that this value is empty and would return a null value hence why it is not being returned in the request.
I've adde a value for this now and made the request again, you should now see that the company property is returned in your request.
Jan 21, 20209:49 AM - edited Jan 21, 20209:50 AM
Member
company property not returned when searching contacts
SOLVE
Am I correct in thinking that the 'company' field is actually just a user-entered free text field, rather than the name of the company with the id in associatedcompanyid? 'company name' was also not in the returned set of properties.
If so it seems like a company lookup per returned contact will still be needed (or we programatically go through and set this field.
The Company Name value is referred to as company when referencing the response from this endpoint. We should not be seeing 2 values i.e company_name and company as the former is the label for the internal value company.
Also, you're correct with your observations, this is indeed a user-entered text field rather than an automated field that is associated to the Company Record.
This means that if you're looking to identify the Associated Company you'll need to work with the associatedcompanyid and then fetch the name via the Get Company by ID endpoint found here.
company property not returned when searching contacts
SOLVE
Thanks for the help Matthew.
I think what we'll do is programatically go through and add custom property for quick referencing a contact's company name or cache the companyid's name on our end to avoid an API call per search result once we're migrated over.