Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

Sort contact and email reports in v3 API

KristineI56
Rookie
0 Votes

How to sort 'contact' and 'email reports' using 'created_at' or 'updated_at' fields in v3 API?

1 REPLY 1
Caleb_A
Employee
0 Votes

My name is Caleb and I'm a member of Constant Contact’s API Developer Support.

 

The V3 API does not have the ability to sort contacts / campaigns directly, however we are able to create a request which would provide a response that you can then use to parse and sort the data for the 'created_at' and 'updated_at' times you need.

 

To help gather more relevant data we are able to filter both contacts and campaigns based on the 'updated_at' value that the contact / campaigns currently have.

For contacts this can be achieved by setting your parameter as 'updated_after' and setting the value as the appropriate updated_at time (ISO-8601 Format) to get more relevant responses. There are further examples of how to do this as well as other criteria that you can use in the link provided below.

 

Get a Collection of Contacts:
https://developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

An alternative method to filtering by the updated_at values for contacts would be to make a request to create a .csv file which would contain both values which you can then parse the response for the data.

 

Exporting a CSV File:
https://developer.constantcontact.com/api_reference/index.html#!/Bulk_Activities/postContactsExport

 

For campaigns you will need to set the parameter as either 'before_date' or 'after_date' and set the value to the appropriate updated_at time (ISO-8601 Format) to gather more relevant responses. You may also use these parameters to get a range of campaigns last updated within a specific time-frame. I have provided the link which explains this process in further detail below.

 

Get a Collection of Emails:
https://developer.constantcontact.com/api_reference/index.html#!/Email_Campaigns/retrieveEmailCampai...

 

Please have a look and let us know if you have any other questions!


Regards,

Caleb A.
API Support Specialist

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up