Hello,
Is there a query to get a list of all contact/address IDs for our local records?
Is there an officially proper way that we should start up our local records?
Thanks.
Hello,
Is there a query to get a list of all contact/address IDs for our local records?
Is there an officially proper way that we should start up our local records?
Thanks.
All your account’s Contact records are available with a single API call to https://{{yourAccountName}}.api-us1.com/api/3/contacts
There are many optional parameters available for this endpoint, including filtering by list, tags, and many more. Documentation here: https://developers.activecampaign.com/reference/list-all-contacts.
We do not have any recommendations as to how to setup your local records. When you make a GET call to /contacts
You will get a list of contacts returned like this, and you can see the email address and contact ID is available on the object:
{
"scoreValues": [],
"contacts": [
{
"cdate": "2022-04-18T15:14:04-05:00",
"email": "johnDoe@example.com",
"phone": "7223224241",
"firstName": "Johnzz",
"lastName": "Doezzz",
"orgid": "0",
"orgname": "",
"segmentio_id": "",
"bounced_hard": "0",
"bounced_soft": "0",
"bounced_date": "0000-00-00",
"ip": "0",
"ua": "",
"hash": "a0cda57d612333283947fuf861c485f8",
"socialdata_lastcheck": "0000-00-00 00:00:00",
"email_local": "",
"email_domain": "example.com",
"sentcnt": "0",
"rating_tstamp": "0000-00-00",
"gravatar": "0",
"deleted": "0",
"anonymized": "0",
"adate": "2022-06-24T14:09:09-05:00",
"udate": "2022-06-24T11:12:05-05:00",
"edate": "2022-06-24T11:00:25-05:00",
"deleted_at": "0000-00-00 00:00:00",
"created_utc_timestamp": "2022-04-18 15:14:04",
"updated_utc_timestamp": "2022-06-24 11:12:05",
"created_timestamp": "2022-04-18 15:14:04",
"updated_timestamp": "2022-06-24 11:12:05",
"created_by": "0",
"updated_by": "0",
"email_empty": false,
"mpp_tracking": "0",
"scoreValues": [],
"accountContacts": [],
"links": {
"bounceLogs": "https://yourAccountName.api-us1.com/api/3/contacts/14/bounceLogs",
"contactAutomations": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactAutomations?limit=1000&orders%5Blastdate%5D=DESC",
"contactData": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactData",
"contactGoals": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactGoals",
"contactLists": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactLists",
"contactLogs": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactLogs",
"contactTags": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactTags",
"contactDeals": "https://yourAccountName.api-us1.com/api/3/contacts/14/contactDeals",
"deals": "https://yourAccountName.api-us1.com/api/3/contacts/14/deals",
"fieldValues": "https://yourAccountName.api-us1.com/api/3/contacts/14/fieldValues",
"geoIps": "https://yourAccountName.api-us1.com/api/3/contacts/14/geoIps",
"notes": "https://yourAccountName.api-us1.com/api/3/contacts/14/notes",
"organization": "https://yourAccountName.api-us1.com/api/3/contacts/14/organization",
"plusAppend": "https://yourAccountName.api-us1.com/api/3/contacts/14/plusAppend",
"trackingLogs": "https://yourAccountName.api-us1.com/api/3/contacts/14/trackingLogs",
"scoreValues": "https://yourAccountName.api-us1.com/api/3/contacts/14/scoreValues",
"accountContacts": "https://yourAccountName.api-us1.com/api/3/contacts/14/accountContacts",
"automationEntryCounts": "https://yourAccountName.api-us1.com/api/3/contacts/14/automationEntryCounts"
},
"id": "14",
"organization": null
}
]
}
I’m aware of the contacts call but it only returns a limited number of entries. It’s my understanding that the AC servers use a max size limit with API responses and as a result this only returns 20 contacts. There is a field at the end of the response that states that I have over 2,000 contacts in total.
I have experience with Python but I am new to the library requests. It is my understanding that responses will often contain an entry “next” which can be used to get the next batch. However, response.next is always None for me. How do I progress through to get each batch?
In the response, in “meta” there are two keys: limit and offset. Perhaps there is a way to increase the limit to be equal to the total number of entries and get all entries at once, or offset can be incremented along to get the next group. However, I’m not finding anything on the site documentation that specifies how these can be changed. Page referenced: List, search, and filter contacts (activecampaign.com)