API call example:
JSON
{
"function":"mailkit.email.unsubscribe.getstatus",
"id":"client_id",
"md5":"client_md5",
"parameters":{
"email":"email",
"ID_email":"ID_email"
}
}
XML
<?xml version="1.0"?>
<methodCall>
<methodName>mailkit.email.unsubscribe.getstatus</methodName>
<params>
<param>
<value>
<int>client_id</int>
</value>
</param>
<param>
<value>
<string>client_md5</string>
</value>
</param>
<param>
<value>
<int>ID_email</int>
</value>
</param>
</params>
</methodCall>
Values
client_id* = client API ID can be found in your Mailkit account's menu Profile/Integration.
client_md5* = MD5 code can be found in your Mailkit account's menu Profile/Integration.
ID_email* = For XML calls, it can contain either a specific email ID or an email address..
email* = email address
The JSON variant of the call requires the email or ID_email to be passed as separate parameters.
* required value
Successful call response:
Example 1 - Recipient is NOT unsubscribed, and if campaign topics are used in the account, all enabled topics are active (not unsubscribed of any topics in use)
JSON
{
"email": "example@example.eu",
"error_status": "0",
"topics": null,
"ID_email": "123456789",
"unsubscribe": "FALSE",
"timeout": {
"date": "0000-00-00"
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>FALSE</string>
</value>
</param>
</params>
</methodResponse>
Values
FALSE = email address is not unsubscribed (XML)
email = email address
error_status = error code
topics = campaign topics that were unsubscribed
ID_email = email address ID
unsubscribe = unsubscription status of the recipient (FALSE = recipient is not unsubscribed)
timeout: date = unsubscribe expiration date (when user unsubscribes temporarily). Value of 0000-00-00 means the expiration is not set and unsubscribe is permanent (default).
Example 2 - the recipient IS completely unsubscribed (for example, recipient unsubscribed using a link in the email or using the API call mailkit.email.unsubscribe (the same applies to recipients who opted out only temporarily, i.e. a timeout value was set)
JSON
{
"email": "example@example.cz",
"error_status": "0",
"topics": null,
"ID_email": "123456789",
"unsubscribe": "TRUE",
"timeout": {
"date": "2018-10-10"
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>TRUE</string>
</value>
</param>
</params>
</methodResponse>
TRUE = email address is unsubscribed (XML)
email = email address
error_status = error code
topics = topics that were unsubscribed
ID_email = email address ID
unsubscribe = unsubscription status of the recipient (TRUE = recipient is unsubscribed)
timeout: date = unsubscribe expiration date (when user unsubscribes temporarily). Value of 0000-00-00 means the expiration is not set and unsubscribe is permanent (default).
Example 3 - the recipient IS partially unsubscribed (only unsubscribed from some campaign topics enabled in the account)
JSON
{
"error_status": "0",
"timeout": {
"date": "0000-00-00"
},
"email": "example@example.com",
"topics": [
{
"ID_TOPIC": 123,
"UNSUBSCRIBE": "FALSE",
"ID_UNSUBSCRIBE_GROUP": 123,
"NAME": "Newsletters",
"STATUS": "enabled",
"DESCRIPTION": "News in the assortment, special offers."
},
{
"ID_TOPIC": 456,
"UNSUBSCRIBE": "TRUE",
"ID_UNSUBSCRIBE_GROUP": 456,
"NAME": "Blog",
"STATUS": "enabled",
"DESCRIPTION": "Tips, tricks, tutorials .."
}
],
"unsubscribe": "FALSE",
"ID_email": 123456789
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>ID_TOPIC</name>
<value>
<i4>123</i4>
</value>
</member>
<member>
<name>UNSUBSCRIBE</name>
<value>
<string>FALSE</string>
</value>
</member>
<member>
<name>ID_UNSUBSCRIBE_GROUP</name>
<value>
<i4>123</i4>
</value>
</member>
<member>
<name>NAME</name>
<value>
<string>Newsletters</string>
</value>
</member>
<member>
<name>STATUS</name>
<value>
<string>enabled</string>
</value>
</member>
<member>
<name>DESCRIPTION</name>
<value>
<string>News in the assortment, special offers.</string>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>ID_TOPIC</name>
<value>
<i4>456</i4>
</value>
</member>
<member>
<name>UNSUBSCRIBE</name>
<value>
<string>TRUE</string>
</value>
</member>
<member>
<name>ID_UNSUBSCRIBE_GROUP</name>
<value>
<i4>456</i4>
</value>
</member>
<member>
<name>NAME</name>
<value>
<string>Blog</string>
</value>
</member>
<member>
<name>STATUS</name>
<value>
<string>enabled</string>
</value>
</member>
<member>
<name>DESCRIPTION</name>
<value>
<string>Tips, tricks, tutorials..</string>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
UNSUBSCRIBE = indicates whether the email address is unsubscribed from a specific topic. It takes the values TRUE (the recipient IS unsubscribed from the topic) or FALSE (the recipient IS NOT unsubscribed from the topic).
unsubscribe (JSON only) = indicates whether the email address is unsubscribed from all messages. It takes the values TRUE (recipient is unsubscribed) or FALSE (recipient is not unsubscribed).
ID_TOPIC = campaign topic ID
NAME = campaign topic name
STATUS = campaign topic status (enabled = displayed on the unsubscribe page) or disabled = not displayed on the unsubscribe page)
DESCRIPTION = campaign topic description
error_status (JSON) = error code
timeout: date (JSON) = unsubscribe timeout expiration date (temporary unsubscribe feature). A value of "0000-00-00" means that the timeout is not set.
email (JSON) = recipient's email address
topics (JSON) = campaign topics
ID_email (JSON) = ID of the email address