Hi,
With Infusionsfot XML RPC API ContactService.findByEmail method: How do I differentiate between a Company and a Contact? I was expecting to receive a ContactType for each Contact, but it’s not present
Or is this possible with the new API?
Hi,
With Infusionsfot XML RPC API ContactService.findByEmail method: How do I differentiate between a Company and a Contact? I was expecting to receive a ContactType for each Contact, but it’s not present
Or is this possible with the new API?
The ContactService.findByEmail will always return a contact. If you’re storing a company in your contacts you can set a custom Person Type as Company and set that on the contact records that are companies, and then use the ContactType to test when making your API requests.
You could also use the DataService.query and test for the email address where the ContactType = “Company” … if you setup the custom contact type as “Company”.
On our newer API offerings (REST v2) we have split the objects logically into a Contact and Company records, regardless of how they are stored in the database. You can search on those by email address using the following syntax:
GET https://api.infusionsoft.com/crm/rest/v2/contacts?fields=email_address&filter=email==test@gmail.com
GET https://api.infusionsoft.com/crm/rest/v2/companies?fields=email_address&filter=email==test@gmail.com