Hi can anybody tell me how I can get total count of contacts in a contact list? Which API should be used for this functionality?

Regular Participant

Hi can anybody tell me how I can get total count of contacts in a contact list? Which API should be used for this functionality?

Hi can anybody tell me how I can get total count of contacts in a contact list? Which API should be used for this functionality?

Regards

Akhilesh
4 REPLIES 4
Frequent Participant

The most direct way to do this is to Create an Export Activity using the Activities Resource. You can identify the Contact List of interest and review the results of the export.
Tom M
Group Product Manager – Content Editing
Constant Contact
Regular Participant

Hi Tom,

I tried creating an Export Activity as explained in the docs but I'm always getting an error 400 "Bad Request". Content I'm posting to Activity URL is following:

"activityType=EXPORT_CONTACTS&fileType=CSV&exportOptDate=true&exportOptSource=true&exportListName=true&sortBy=DATE_DESC&columns=FIRST+NAME&columns=LAST+NAME&columns=EMAIL+ADDRESS&columns=HOME+PHONE&columns=WORK+PHONE&columns=ADDRESS+LINE+1&columns=ADDRESS+LINE+2&columns=CITY&columns=STATE&columns=POSTAL+CODE&columns=COUNTRY&columns=CUSTOM+FIELD+1&columns=CUSTOM+FIELD+2&columns=CUSTOM+FIELD+3&columns=CUSTOM+FIELD+4&columns=CUSTOM+FIELD+5&columns=CUSTOM+FIELD+6&lists=http%3a%2f%2fapi.constantcontact.com%2fws%2fcustomers%2fakhilesh%2flists%2f49"

Can you suggest me what is wrong in this?

Regards

Akhilesh
Regular Participant

Hi Tom,

I found the issue. &lists= should have been &listId= in the above content.

right content would be as following:

"activityType=EXPORT_CONTACTS&fileType=CSV&exportOptDate=true&exportOptSource=true&exportListName=true&sortBy=DATE_DESC&columns=FIRST+NAME&columns=LAST+NAME&columns=EMAIL+ADDRESS&columns=HOME+PHONE&columns=WORK+PHONE&columns=ADDRESS+LINE+1&columns=ADDRESS+LINE+2&columns=CITY&columns=STATE&columns=POSTAL+CODE&columns=COUNTRY&columns=CUSTOM+FIELD+1&columns=CUSTOM+FIELD+2&columns=CUSTOM+FIELD+3&columns=CUSTOM+FIELD+4&columns=CUSTOM+FIELD+5&columns=CUSTOM+FIELD+6&listId=http%3a%2f%2fapi.constantcontact.com%2fws%2fcustomers%2fakhilesh%2flists%2f49"

Regards

Akhilesh
Regular Participant

Hi Tom,

Can you give me an idea about how to check result of an export activity?

Regards

Akhilesh
Developer Portal

View API documentation, code samples, get your API key.

Visit Page