According to the API documentation with regard to the `unsubscribe` endpoint, a contact gains the attribute and value pair of status=unsubscribed, however when looking up a contact via the endpoint GET request of /contacts?email=<email_address>, there is no status attribute. I can see that I can search contacts based on a filter of status=unsubscribed, but if I'm doing a contact lookup in order to get the contact ID in order to unsubscribe or delete (documentation also states there should be a status=deleted attribute and value pair associated to the account), how can I tell if the contact is already unsubscribed or deleted (to not worry about actually making the request to unsubscribe and/or delete)?
It looks like the return payload includes permission_to_send having a value of unsubscribed would be a valid identifier. It also looks like only deleted contacts have the deleted_at attribute in their return value payload. The documentation doesn't really refer to this though. Can I get verification on this?
Solved! Go to Solution.
Hello GinaM823,
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.
When using the GET Contacts Collection endpoint (GET /contacts), the "permission_to_send" parameter in the response body will indicate whether the contact is unsubscribed.
"permission_to_send"
Identifies the type of permission that the Constant Contact account has to send email to the contact. Types of permission: explicit, implicit, not_set, pending_confirmation, temp_hold, unsubscribed.
Additionally, you'll want to set the status query parameter to "ALL" in your request, as when you leave that parameter blank, the results returned only include active contacts, so you wouldn't see any that were unsubscribed, deleted, or both in the response body.
"status"
Use the status query parameter to search for contacts by status. This parameter accepts one or more comma separated values: all, active, deleted, not_set, pending_confirmation, temp_hold, and unsubscribed.
Here is an example of what your GET call might look like:
GET https://api.cc.email/v3/contacts?status=all&email=email@example.com
In the JSON response body, "permission_to_send" will indicate whether the contact is unsubscribed, regardless of whether they have been deleted from the account, and if the contact includes the header "deleted_at", this will indicate that the contact is currently deleted. If that contact is later re-added, "deleted_at" will no longer display in the results.
"deleted_at"
For deleted contacts (email_address contains opt_out_source and opt_out_date), shows the date of deletion.
GET Contacts Collection
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts
Please have a look and let us know if you have any other questions!
It also seems that the address property of the email_address group is also required, as is update_source. Hard to tell since the examples contain extraneously provided information, and the description of the documentation simply states the permission_to_send and opt_out_reason need to be set (even if opt_out_reason is null).
Hello GinaM823,
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.
When using the GET Contacts Collection endpoint (GET /contacts), the "permission_to_send" parameter in the response body will indicate whether the contact is unsubscribed.
"permission_to_send"
Identifies the type of permission that the Constant Contact account has to send email to the contact. Types of permission: explicit, implicit, not_set, pending_confirmation, temp_hold, unsubscribed.
Additionally, you'll want to set the status query parameter to "ALL" in your request, as when you leave that parameter blank, the results returned only include active contacts, so you wouldn't see any that were unsubscribed, deleted, or both in the response body.
"status"
Use the status query parameter to search for contacts by status. This parameter accepts one or more comma separated values: all, active, deleted, not_set, pending_confirmation, temp_hold, and unsubscribed.
Here is an example of what your GET call might look like:
GET https://api.cc.email/v3/contacts?status=all&email=email@example.com
In the JSON response body, "permission_to_send" will indicate whether the contact is unsubscribed, regardless of whether they have been deleted from the account, and if the contact includes the header "deleted_at", this will indicate that the contact is currently deleted. If that contact is later re-added, "deleted_at" will no longer display in the results.
"deleted_at"
For deleted contacts (email_address contains opt_out_source and opt_out_date), shows the date of deletion.
GET Contacts Collection
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts
Please have a look and let us know if you have any other questions!
Announcements
Join our list to be notified of new features and updates to our V3 API.
Sign Up