Function mailkit.email.unsubscribe is used to unsubscribe recipient.
<?xml version="1.0"?>
<methodCall>
<methodName>mailkit.email.unsubscribe</methodName>
<params>
<param>
<value>
<int>client_id</int>
</value>
</param>
<param>
<value>
<string>client_md5</string>
</value>
</param>
<param>
<value>
<int>email_id</int>
</value>
</param>
<param>
<value>
<int>ID_send_message</int>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>timeout</name>
<value>
<string>true</string>
</value>
</member>
<member>
<name>timeout_days</name>
<value>
<string>60</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
{
"function":"mailkit.email.unsubscribe",
"id":"client_id",
"md5":"client_md5",
"parameters":{
"send_optout":"FALSE",
"email":"email@example.com",
"ID_email":null,
"ID_send_message":"",
"timeout":"true",
"timeout_days":"60"
}
}
client_id* = client ID can be found in your Mailkit account's menu Profile / Integration / API settings.
client_md5* = MD5 code can be found in your Mailkit account's menu Profile / Integration / API settings.
email_id* = may contain ID of e-mail address, (returned by mailkit.mailinglist.adduser), or e-mail address. When this function is called the email specified will be marked as unsubscribed and won't be available for any future campaign deliveries.
ID_send_message = ID of a specific campaign delivery (Optional). When provided the unsubscribe will be recorded for the specific delivery.
send_optout = send opt-out confirmation email
timeout = activate temporary unsubscribe - allowed values TRUE / FALSE
timeout_days = number of days for the unsubscribe to expire after, eg. how long will the recipient stay unsubscribed - allowed values are 14-90.
* required value
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<i4>282837490</i4>
</value>
</param>
</params>
</methodResponse>
{
"error_status": "0",
"ID_email": "123456789",
"status": "1"
}
XML response only returns the ID of unsubscribed e-mail or email address in case the address doesn't exist in any lists.
JSON response contains:
ID_email - ID of the unsubscribed email address or email address in case the address doesn't exist in any lists.
error_status - error code
status - 1 (recipient unsubscribe succesfully), 2 (recipient has already been unsubscribed)
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>unknown email</string>
</value>
</param>
</params>
</methodResponse>
{
"error_status":1,
"error":"Missing ID_email or email"
}
Invalid ID_email or email = e-mail address or ID e-mail was invalid or not found in the account