https://<subdomain>.sendsmaily.net/api/contact.php


POST method must be used for this query.


Parameters

All parameters must be URL encoded.


  

Parameter

Value

email

Email address. Must be exact (wildcard does not work). Required.

is_unsubscribed

Has the email address been set as unsubscribed? 0 - no, emails will be delivered; 1 - yes, email address will be excluded from all campaigns.

...

Custom fields. New fields will be automatically created and attached with subscriber data. Text field.


Example query:


Unsubscribing an email address


Query to set support@smaily.com as unsubscribed.

  

$username = 'YOUR_USERNAME';
$password = 'YOUR_PASSWORD';
$location = 'https://<subdomain>.sendsmaily.net/api/contact.php';
$query = 'email=support%40smaily.com&is_unsubscribed=1';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $location);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");

$result = curl_exec($ch);
curl_close($ch);

  

Result for a successful query:


{
  'code': 101,
  'message': 'OK'
}


 

See also other possible results from Possible results.