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


POST method must be used for this query.


Parameters

All parameters must be URL encoded, but grouped in an array (you can see an example below).


Parameter

Value

email

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

is_unsubscribed

0 - not unsubscribed, emails will be delivered;

1 - unsubscribed, email address will be excluded from all campaigns, even though the address can still be in the database and be included in filters.

is_deleted

0 - address is visible and can be used in filters;

1 - address is hidden from the database, from every filter and is not included in campaigns. Custom fields are emptied. (Un-)subscribed status is kept.

...

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


Example query:


Updating several subscribers at once


Query to update tugi@smaily.com and add info@smaily.com.

  

$username = 'YOUR_USERNAME';
$password = 'YOUR_PASSWORD';
$location = 'https://<subdomain>.sendsmaily.net/api/contact.php';
$query = array(
  array(
    'email' => 'tugi@smaily.com',
    'is_unsubscribed' => 1,
  ),
  array(
    'email' => 'info@smaily.com',
    'is_unsubscribed' => 0,
    'kuuluvus_1' => 'ei',
  ),
);

// Query ($query) should be posted as following.
// In our example it will be taken care of by “http_build_query” function.
// 0%5Bemail%5D=tugi%40smaily.com&0%5Bunsubscribed%5D=1&1%5Bemail%5D=info%40smaily.com&1%5Bunsubscribed%5D=0&1%5Bkuuluvus_1%5D=ei

$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, http_build_query($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.