get_contacts_deleted
Section: Contacts
Version: 1.5.0
Get deleted contacts.
Conditions:
- campaigns / get_campaigns (optional) – Search only in given campaigns. Uses OR logic. If those params are not given search is performed in all campaigns on the account. Check IDs in conditions for detailed explanation.
- messages / get_messages (optional) – Search only contacts removed from given messages, this info is known for example if contact clicked unsubscribe link. Uses OR logic. CCheck IDs in conditions for detailed explanation.
- email (optional) – Use text operators to narrow down search results to specific contact emails.
- reason (optional) – Narrow down search results only to contacts removed due to specific reason, allowed values are: unsubscribe, user, support, automation (or more specific automation::remove-on-remove, automation::remove-on-sale, automation::remove-on-subscribe), complaint, blacklisted, api, bounce (or more specific bounce::mailbox_full, bounce::other_hard, bounce::other_soft, bounce::user_unknown, bounce::user_recycled), other.
- created_on (optional) – Use time operators to narrow down search results to specific contact creation date. Multiple operators are allowed and logic AND is used so date range can also be expressed.
- deleted_on (optional) – Use time operators to narrow down search results to specific contact deletion date. Multiple operators are allowed and logic AND is used so date range can also be expressed.
Warning: Reasons in result are always general even if you requested specific one.
Warning: Unsubscribe link allows contact to unsubscribe from multiple campaigns, even if message was not sent from those campaigns or to contact in those campaigns.
Warning: Value of CONTACT_ID does not change after contact is deleted but you can no longer use it in other API calls, Missing contact error will be returned.
Hint: If you want to keep unsubscribes synchronized with external database, then setting unsubscribe callback is much more efficient than querying this method periodically.
Parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | API_KEY | |||||||||||||||||||||||||||||||||||||||||||||||||||||
object |
|
Return Value | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | CONTACT_ID |
|
Example Request JSON
[
"API_KEY",
{
"campaigns": [
"CAMPAIGN_ID",
"CAMPAIGN_ID"
],
"get_campaigns": {
"name": {
"CONTAINS": "my_campaign_%"
}
},
"messages": [
"MESSAGE_ID",
"MESSAGE_ID"
],
"get_messages": {
"name": {
"CONTAINS": "my_message_%"
}
},
"email": {
"OPERATOR": "value"
},
"reason": "value",
"created_on": {
"OPERATOR": "value"
},
"deleted_on": {
"OPERATOR": "value"
}
}
]
Example Response JSON
{
"CONTACT_ID": {
"campaign": "CAMPAIGN_ID",
"message": "MESSAGE_ID",
"name": "My Contact Name",
"email": "my_contact_2@emailaddress.com",
"origin": "api",
"ip": "1.1.1.1",
"cycle_day": null,
"reason": "other",
"created_on": "2010-01-01 00:00:00",
"deleted_on": "2010-01-01 00:00:00"
}
}
API-wide Errors | |
---|---|
API key verification failed | API key verification failed |
API client IP not allowed | API client IP not allowed |
Invalid params | Attribute params must be reference to hash |