Using REST API how do I GET a list of contacts by company id?

Given the company ID, I need to pull a list of the contact associated with the company. How do I accomplish this?
BTW, I’m using REST API and testing through Postman
Also, we’re developing in PHP and I think there an SDK we can use. Any guidance here would be good.

PHP SDK: GitHub - infusionsoft/infusionsoft-php: PHP client library for the Infusionsoft API.

When using the PHP SDK you can leverage the DataService query method to get the list of contacts for a particular CompanyId. It would look something like this:

$data = app('infusionsoft')->data()->query("Contact",1000,0,['CompanyID' => '123'],['Id','FirstName','LastName','Email'], 'Id', false);

The above would query all entries in the Contact table where the CompanyID = 123. It will return Id, first, last, and email address fields for each of the matching contacts.

Ok. Great! I’ve found the data schema and seemed to be cooking with gas now!
so one more question, how do I retrieve all of the user records at one time?

https://developer.infusionsoft.com/docs/rest/#!/Users/listUsersUsingGET

Justin,

Can you tell me where the content for sent and received emails is store within Keap? I have the contact ID and need to collect the email content for the contact. In which table/field can I find it? The https://developer.infusionsoft.com/docs/table-schema/#DataFormField scheme doesn’t show where it may be.

Kind Regards,

Robert DeVargas, PhD

Project Coordinator

robert@eternalinteractive.com

www.eternalinteractive.com

o: 1-866-8-ETERNAL (866-838-3762)

f: 1-866-617-2453

image001.png

Regarding email history we do have a rest endpoint that allows you to retrieve sent email: Keap REST API

However, I think this is just outgoing email and does not include incoming email history (to the local mail client or sync’d from the Gmail plugin for example)

Gotcha. I’m using the SDK methods. So I’ll need to shift over to use REST API to grad the outgoing email content? No way to get those through the SDK?

Kind Regards,

Robert DeVargas, PhD

Project Coordinator

robert@eternalinteractive.com

www.eternalinteractive.com

o: 1-866-8-ETERNAL (866-838-3762)

f: 1-866-617-2453

image001.png

The SDK is just a wrapper for the XmlRpc and Rest APIs. It shortens the amount of code you need to write to use them.

It doesn’t look like the email history endpoint is currently written into the SDK, but you can add the code to implement it in there. Bonus karma if you also create a pull request on GitHub :slight_smile: