Hello @LizC655,
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.
After working on this issue via email, we saw there were a combination of issues between missing elements and an invalid property being used. That invalid property in the code is "permission_to_send". Also the code was missing some brackets, a list to add the contact to, and the opt_in_source for the contact. Just in case, below is an example of the coding with invalid properties removed and missing elements added.
POST Address I Used: https://api.constantcontact.com/v2/contacts?api_key=ABC&action_by=ACTION_BY_VISITOR
{
"email_addresses":
[
{
"opt_in_source": "ACTION_BY_VISITOR",
"email_address": "test1142021@test.com"
}
],
"first_name": "test",
"last_name": "test",
"lists": [
{
"id": "123456"
}
]
}
Also, below is a link to documentation which has all a list of all the valid fields when doing a POST for adding a contact.
Contacts Collection Endpoint
https://v2.developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST
Please feel free to respond to the email if you have any additional questions.
Regards,
... View more