GET /api/message/send.php

Request parameters

Request body must be a JSON serialized string. Maximum allowed request body is 64MB.

autoresponder_idAutomation ID. Required.
fromObject with sender data. Structure is described in "Parameter from structure" section. Sender data falls back to autoresponder configured values, if parameter is omitted from request.
toList of message recipients. Required.
contextObject of message variables. Structure is described in "Parameter context structure" section.
attachmentsList of message attachment objects. Object structure is described in "Parameter attachments structure" section.

Parameter from structure

emailSender email address. Required
nameSender name. Required.

Parameter context structure

...Value will be normalized to string.

Parameter attachments structure

Note! Either use content or url parameter. Using both is not allowed.

contentAttachment content in Base64 encoding.
urlPublic, not password protected URL to file. Only http and https protocols are allowed.
filenameAttachment name in message. Required.

Response parameters

codeError code. For successful request the value will be 101.
messageHuman-readable error message. For successful request the value will be "OK".
message_idsList of queued message IDs. Each value is a unsigned 64-bit long. Only included with successful API request.

Example request

$username = 'API_USERNAME';
$password = 'API_PASSWORD';
$location = 'https://<subdomain>';
$query = array(
  'autoresponder_id' => 1,
  'from' => array(
    'email' => '',
    'name' => 'Sendsmaily',
  'to' => array('', ''),
  'context' => array(
    'name' => 'John Doe',
    'city' => 'Tallinn'
  'attachments' => array(
      'content' => 'dGVzdA==',
      'filename' => 'Fail 1.txt',
      'url' => '',
      'filename' => 'Fail 2.pdf',

$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, json_encode($query));
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");

$result = curl_exec($ch);

Example response

  "code": 101,
  "message": "OK",
  "message_ids": [140737488355328]