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

Sample JSON Payload to add a contact and add it to a list in API tester

GaryC9
Constant Contact Partner
0 Votes

I am using v2 API tester to add a contact and add it to a list. However, I cannot get the JSON payload correct. I can get a contact so I know I have a valid connection.

Can you check the payload below and tell me what the simple answer is?

error

 

[{
   
"error_key": "json.field.invalid",
   
"error_message": "#/import_data: Property was found but is not permitted at this location."
}, {
   
"error_key": "json.field.missing",
   
"error_message": "#/email_addresses: Property is required but not found."
}]

simplest payload I tried

 

{"import_data":[{
"email_addresses":["test@test.com"],
"first_name":"test",
"last_name":"User"}]

}

1 REPLY 1
John__B
Employee
0 Votes

Hello GaryC9,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

I’m sorry to hear that you’ve encountered issues while attempting to add contacts to your lists via our V2 API. Could you confirm which endpoint you’re using for this request? Based on your code It looks like it’s either the Contacts Collections endpoint or the Bulk Activities Import Contacts endpoint.

 

Contacts Collections Endpoint:

https://v2.developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST

 

Bulk Activities Import Contacts Endpoint:

https://v2.developer.constantcontact.com/docs/bulk_activities_api/bulk-activities-import-contacts.ht...

 

I would also note that while our V2 API endpoints are currently functional, we do plan to deprecate them and I would highly recommend moving your application to our V3 API. For more information on this version, I am including some documentation below. 

 

Getting Started Guide for V3:

https://developer.constantcontact.com/api_guide/index.html

 

Create or Update a Contact using a SIngle Method:

https://developer.constantcontact.com/api_guide/contacts_create_or_update.html

 

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

 

Regards,


John B.
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