LianaMailer REST API documentation

Download OpenAPI specification:Download

REST API of LianaMailer

Rest-client

Open source REST client can be found at github.

Most code examples use client for constructing the message including headers and authenticating.

Restrictions

Request rate

Max request rate is four per second. Exceeding this can result in 429 Too Many Requests -error.

Reserved property names

When creating or importing new data to LianaMailer, following names cannot be used for properties since they are reserved for system:
  • admin
  • archive
  • delivery_id
  • email
  • id
  • ip
  • list_id
  • list_name
  • mail_id
  • origin
  • reason
  • recipient_email
  • recipient_sms
  • scheduled
  • sms
  • subject
  • tracking_id
  • url
  • useragent
Using these as property names will result in error or import failing.

Headers

Headers

Headers to include in request (case sensitive):

  • Content-Type: application/json
  • Content-MD5: md5-hash of json encoded content array (with GET method, this is made of empty string)
  • Date: current timestamp i.e. '2020-01-20T12:30:10+03:00'
  • Authorization: explained below

Authorization header

All requests must include HTTP Authorization header with correct signature. Authentication header is named Authorization and it should be structured as:

(API_REALM) (USER_ID):(HMAC-SIGNATURE)

Signing

HMAC-signature is generated with SHA256 algorithm using API secret as key with following strings in this specific order separated by newline (\n) in between, as data:

  • API-method i.e. GET
  • MD5-hash of content, as described above
  • content-type as: application/json
  • timestamp i.e. 2020-01-20T12:30:10+03:00
  • json encoded content or empty string if sending GET request
  • path to endpoint with possible URL parameters included i.e. /api/v3/events?type=mailopen&at_start=2020-01-10T12:00:00&at_end=2020-01-10T15:00:00

V1 Example

Example for sending "hello" to echoMessage API V1 endpoint.

Data being signed: POST\n1f0bf5038e61951a95c4a2a9db7c400a\napplication/json\n2020-01-15T12:00:00+03:00\n["hello"]\n/api/v1/echoMessage

Example signature generated using secret key 0123456789abcdef0123456789abcdef:
89b60df150aad61e42fef7d6a43883c83e642aef2f7f2338b971c681f9992c26

Example Authorization header for user ID 123 and realm EUR:
EUR 123:89b60df150aad61e42fef7d6a43883c83e642aef2f7f2338b971c681f9992c26

PHP code example on sending getRecipients request.

PHP code example on sending updateRecipient request using Liana rest-client.

V3 Example

Example for sending request to events API V3 endpoint.

Data being signed: GET\nd41d8cd98f00b204e9800998ecf8427e\napplication/json\n2020-01-15T12:00:00+03:00\n\n/api/v3/events?type=mailopen&at_start=2020-01-10T12:00:00&at_end=2020-01-10T15:00:00

Example signature generated using secret key 0123456789abcdef0123456789abcdef:
22404d156bd828b157c3e6e11f5b83943b00bc7b0029eceab304dae227ef7f03

Example Authorization header for user ID 123 and realm EUR:
EUR 123:22404d156bd828b157c3e6e11f5b83943b00bc7b0029eceab304dae227ef7f03

Parameters

While making requests to different API versions it should be kept in mind that parameters work a bit differently in different versions.

V1

All root level parameters should be given in exact same order as they are mentioned in documentation. These parameters are identified by the order they are given in, rather than keys. Parameters themselves can contain tables with keys required. See PHP example. Optional parameters can be set null if not needed.

V2

Parameters are identified by keys so they are to be given as associative arrays.

V3

Since these are all GET requests, all parameters are given in url so content is left empty.

Examples

This is a collection of some common use cases and examples on how to complete them using LianaMailer REST API.

Send newsletter to imported list

In this case we have a list of contacts to which we want to send a newsletter.


1. Import contacts to Mailer


First we are going to create a new mailinglist and upload contacts with emails and some property values into it.

Endpoints used here:

<?php
/**
 * Mailing list import example
 *
 * This example uploads given recipients to LianaMailer™ and waits for the import to finish.
 *
 * Copyright: Liana Technologies Oy 2023
 *
 * Requirements:
 *      - This project/file needs to be UTF-8 formatted
 */

// Enter your API credentials below
$user_id = <id>;
$secret_key = <secret_key>;
$url = <api url>;
$realm = <realm>;

// Details for new list
$list_name = <string>;
$list_description = <string>;

// A ready made PHP client which handles the API communication
// @see https://github.com/LianaTech/rest-client
require_once 'rest-client/php/RestClient.php';

// We will be using v1 API
$apiv1 = new \LianaTech\RestClient($user_id, $secret_key, $url, 1, $realm);

// Create a mailinglist. Note that this will create a new one on every call!
// We use only first 2 parameters of endpoint.
$ret = $apiv1->call('createMailingList', array($list_name, $list_description));

if (empty($ret['succeed']) || empty($ret['result'])) {
    die('unexpected response for createMailingList: ' . json_encode($ret));
}

$mailinglist_id = $ret['result'];

// Lets form the recipient list and their properties
$recipients_csv =<<<EOF
"email";"firstname";"lastname"
"recipient+1@example.com";"John1";"Doe1"
"recipient+2@example.com";"John2";"Doe2"
"recipient+3@example.com";"John3";"Doe3"
"recipient+4@example.com";"John4";"Doe4"
"recipient+5@example.com";"John5";"Doe5"
"recipient+6@example.com";"John6";"Doe6"
"recipient+7@example.com";"John7";"Doe7"
"recipient+8@example.com";"John8";"Doe8"
"recipient+9@example.com";"John9";"Doe9"
"recipient+10@example.com";"John10";"Doe10"
EOF;

// Upload that CSV into the mailinglist
$ret = $apiv1->call('importCSVToMailingList', array(
    $mailinglist_id,
    null, // a deprecated param
    base64_encode($recipients_csv),
    null, // deprecated param, set to null
    true, // base64 encoded data
    true, // truncate the mailinglist first
));

if (empty($ret['succeed'])) {
    die('unexpected response for importCSVToMailingList: ' . json_encode($ret));
}

// Wait for the list import to finish
$start = time();
$import_success = false;
$wait = 600; // seconds, increase if you are using huge lists

while (time() < $start + $wait) {
    sleep(1);
    $ret = $apiv1->call('getImportStatus', array($mailinglist_id));

    if (isset($ret['result']) && $ret['result'] === -1) {
        $import_success = true;
        break; // import finished
    }
}

if (! $import_success) {
    die('mailinglist import never finished. last output: ' . json_encode($ret));
}

echo "All done!\n";

2. Send newsletter to list


Next we are going to send a newsletter built in LianaMailer UI, to a list uploaded earlier using batch-send endpoint.
<?php

/**
 * Sending newsletter using batch-send
 *
 * This example setups a newsletter for sending via REST API
 *
 * Copyright: Liana Technologies Oy 2023
 *
 * Requirements:
 *      - This project/file needs to be UTF-8 formatted
 *      - Draft used in this example is created beforehand in LianaMailer UI
 */

// Enter your API credentials below
$user_id = <id>;
$secret_key = <secret_key>;
$url = <api url>;
$realm = <realm>;

// A ready made PHP client which handles the API communication
// @see https://github.com/LianaTech/rest-client
require_once 'rest-client/php/RestClient.php';

// We will be using v2 API
$apiv2 = new \LianaTech\RestClient($user_id, $secret_key, $url, 2, $realm);

// Array of target list ids. Like one uploaded in previous example can also be used.
$lists = array(12345);

// We need to define letter to be used. Type should be 'draft' and id should refer to draft created in LianaMailer UI.
$letter = array(
  'type' => 'draft',
  'id' => 95
);

$params = array(
  'letter' => $letter,
  'lists' => $lists
);

$ret = $apiv2->call(
  'deliveries/batch-send',
  $params,
  'POST'
);

if (empty($ret['succeed']) || empty($ret['result'])) {
    die('unexpected response for deliveries/batch-send: ' . json_encode($ret));
}

Notice that you can also give recipients with necessary properties manually by inserting them into recipients array. This can be used with or without lists param:

$recipients = array(
  array(
    'email' => 'recipient1@example.com',
    'firstname' => 'John'
  ),
  array(
    'email' => 'recipient2@example.com',
    'firstname' => 'Jane'
  )
);
$params = array(
  'letter' => $letter,
  'lists' => $lists,
  'recipients' => $recipients
);

It is also possible to modify content of message by using optional fields in letter as explained in event-send example.

Fetch events

In this example we fetch tracking events from v3/events endpoint.

Parameters used here are:

  • event type is mailopen
  • fetch only events dated between 2020-01-30T12:00:00 and 2020-01-31T12:00:00
  • fetch results in pages of 100 events
  • results are sorted by event time in descending order
<?php

/**
 * Event fetch example
 *
 * This example gets events from v3/events endpoint with specific conditions.
 *
 * Copyright: Liana Technologies Oy 2023
 *
 * Requirements:
 *      - This project/file needs to be UTF-8 formatted
 */

// Enter your API credentials below
$user_id = <id>;
$secret_key = <secret_key>;
$url = <api url>;
$realm = <realm>;

// A ready made PHP client which handles the API communication
// @see https://github.com/LianaTech/rest-client
require_once 'rest-client/php/RestClient.php';

// We will be using v3 API
$apiv3 = new \LianaTech\RestClient($user_id, $secret_key, $url, 3, $realm);

// Define paginating values
$page_size = 100; // Results per page
$offset = 0;
$page_num = 0;

// Array to gather all results into
$results_array = array();

// Iterate thru results using pagination
do {
  // Additional delay to ensure we are not sending requests too frequently.
  sleep(1);

  $offset = $page_size * $page_num;
  $page_num++;

  // It is recommended to give params to limit the amount of data to be fetched at once.
  $params = array(
    'type' => 'mailopen', // Event type we are looking for
    'at_start' => '2020-01-30T12:00:00', // Find events after x
    'at_end' => '2020-01-31T12:00:00', // Find events before x
    'limit' => $page_size, // Amount of results we want to fetch at time
    'offset' => $offset, // Skip amount of results
    'sort' => '-at' // Sorting by time, descending
  );

  $ret = $apiv3->call(
    'events?' . http_build_query($params),
    array(),
    'GET'
  );

  $results_array = array_merge($results_array, $ret['items']);

} while (count($ret['items']) == $page_size);

Sending transactional mail

Sending a transactional, or other more recipient specific mail can be done using v3/event-send endpoint.

  <?php

  /**
   * Sending event mail using event-send
   *
   * This example builds a transactional message for sending via REST API
   *
   * Copyright: Liana Technologies Oy 2023
   *
   * Requirements:
   *      - This project/file needs to be UTF-8 formatted
   *      - Draft used in this example is created beforehand in LianaMailer UI
   */

  // Enter your API credentials below
  $user_id = <id>;
  $secret_key = <secret_key>;
  $url = <api url>;
  $realm = <realm>;

  // A ready made PHP client which handles the API communication
  // @see https://github.com/LianaTech/rest-client
  require_once 'rest-client/php/RestClient.php';

  // We will be using v2 API
  $apiv2 = new \LianaTech\RestClient($user_id, $secret_key, $url, 2, $realm);

  // Define recipient(s) and their properties
  $recipients = array(
    array(
      'email' => 'recipient@mail.com',
      'firstname' => 'John',
      'lastname' => 'Doe',
      'order_num' => 1234
    )
  );

  // We need to define letter to be used. Type should be 'draft' and id should refer to draft created in LianaMailer UI.
  $letter = array(
    'type' => 'draft',
    'id' => 95,
    'recipients_reset' => true, // Set this to true if it should be possible for same recipient to receive this message multiple times
  );

  $params = array(
    'letter' => $letter,
    'recipients' => $recipients
  );

  $ret = $apiv2->call(
    'deliveries/event-send',
    $params,
    'POST'
  );

  if (empty($ret['succeed']) || empty($ret['result'])) {
    die('unexpected response for deliveries/event-send: ' . json_encode($ret));
  }

Notice that in this case we use a ready made draft containing all the content and placeholders for properties (i.e. $order_num$ etc.).

Overwriting message content of base draft

We might also want to overwrite entire content of draft being used. In that case draft used should be made of source template.

  $letter = array(
    'type' => 'draft',
    'id' => 95,
    'recipients_reset' => true,
    'subject' => 'Order received',
    'html' => '<p>Thank you for your order $firstname$ $lastname$. Order number $order_num$ has been received.</p>'
  );

Personalized HTML blocks

We might also want to use more recipient specific HTML blocks in our message. This can be done using raw type properties. Such property must be created using createCustomerProperty endpoint.

Notice that this only has to be done one time only. After that the property can be used in all future deliveries.

  $params = array(
    'ordered_items_html', // wanted name for the new property
    'FI', // property language, use `FI`
    'raw' // property type, raw allows HTML content
  );
  $apiv1->call('createCustomerProperty', $params, 'POST');

Now that we have a property which can contain custom HTML we can use it in message. NOHTMLENCODE: prefix is required for HTML content to work.

  $recipients = array(
    array(
      'email' => 'recipient@mail.com',
      'firstname' => 'John',
      'lastname' => 'Doe',
      'order_num' => 1234,
      'ordered_items_html' => 'NOHTMLENCODE:
        <table border=1>
          <tr>
            <td>ordered item</td>
            <td>amount</td>
          </tr>
          <tr>
            <td>Foo bar</td>
            <td>2</td>
          </tr>
        </table>'
    )
  );

  $letter = array(
    'type' => 'draft',
    'id' => 95,
    'recipients_reset' => true,
    'subject' => 'Order received',
    'html' => '<p>Thank you for your order $firstname$ $lastname$. Order number $order_num$ has been received:</p> $ordered_items_html$',
  );

Customers

Get customer details

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get default site

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get customer ID

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Get site info

Request Body schema: application/json
site
string

Specific site name. If set to null will return default site for customer.

Responses

Request samples

Content type
application/json
[
  • "example.site"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get all sites

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get excluded members

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get marketing settings

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get site by name

Request Body schema: application/json
site
string

Specific site name.

Responses

Request samples

Content type
application/json
[
  • "example.site"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get syndications

Request Body schema: application/json
delivery
integer

Delivery ID

Responses

Request samples

Content type
application/json
[
  • 1100
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get received SMS

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "source;msg;time;dest;keyword"
}

Get sent mail count

Request Body schema: application/json
object

Search parameters.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 3088
}

Set CEM tracking

Request Body schema: application/json
state
boolean

CEM tracking enabled

Responses

Request samples

Content type
application/json
[
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Set default site

Request Body schema: application/json
site
required
string

Site domain.

language
string

Site language.

welcome
integer

Site welcome message delivery ID.

ssl
integer

Site ssl usage flag.

Responses

Request samples

Content type
application/json
[
  • "new.site",
  • "EN",
  • 1,
  • 1
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "example.site"
}

Set site

Request Body schema: application/json
site
string

If existing site is to be modified, domain name.

id
required
integer

This should be set to 0.

new_name
string

New site domain name.

language
string

Site language.

welcome
integer

Site welcome message delivery ID.

ssl
integer

Site ssl flag

Responses

Request samples

Content type
application/json
[
  • "old.site",
  • 0,
  • "new.site",
  • "EN",
  • 1,
  • 1
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "new.site"
}

Set marketing settings

Request Body schema: application/json
Array of objects

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Set site welcome delivery

Request Body schema: application/json
site
string

Site domain.

welcome
integer

Welcome message delivery ID.

Responses

Request samples

Content type
application/json
[
  • "example.site",
  • 300
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Mailing

Cancel delivery

Attempts to cancel a pending delivery. If this fails, returns a soapfault error. In such case you can attempt a deleteDelivery.

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Cancel related delivery

Attempts to cancel a pending delivery and its related deliveries. If this fails, returns a soapfault error. In such case you can attempt a deleteDelivery.

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Get delivery

Request Body schema: application/json
id
integer

Delivery ID. If omitted will return all the deliveries.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get link data

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": []
}

Get all links

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get mail link data

Request Body schema: application/json
mail_id
required
integer

Mail ID.

Responses

Request samples

Content type
application/json
[
  • 20
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": []
}

Get mail link tracking data

Request Body schema: application/json
mail_id
required
integer

Mail ID.

from
string

Start from date

Responses

Request samples

Content type
application/json
[
  • 20,
  • "2019-12-20 14:00:00"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "link_id;clicked_at;useragent;acceptlanguage;remote_addr;hostname;continent_code;org_name;country_code;country_code3;country_name;region;city;postal_code;latitude;longitude;dma_code;area_code;member_id;member_email"
}

Get mail name

Request Body schema: application/json
mail_id
required
integer

Mail ID.

Responses

Request samples

Content type
application/json
[
  • 20
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "Mail name."
}

Get mail open tracking data

Request Body schema: application/json
mail_id
required
integer

Mail ID.

from
string

Start from date

Responses

Request samples

Content type
application/json
[
  • 20,
  • "2019-12-20 14:00:00"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get mail tracking state

Request Body schema: application/json
mail_id
required
integer

Mail ID.

Responses

Request samples

Content type
application/json
[
  • 20
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get related deliveries

Request Body schema: application/json
delivery_id
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get scheduled deliveries

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get subscription data

Request Body schema: application/json
from
string

Start from date

Responses

Request samples

Content type
application/json
[
  • "2019-12-20 14:00:00"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get tell-a-friend data

Request Body schema: application/json
from
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
[
  • {
    },
  • [
    ],
  • [
    ]
]

Is sending blocked

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": false
}

Hide delivery

Hides a delivery from the report view

Request Body schema: application/json
id
required
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Reschedule delivery to mailinglist

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

list_id
integer

Mailinglist ID.

object

Responses

Request samples

Content type
application/json
[
  • 10,
  • 60,
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 2010
}

Set archived state

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

archive
required
Array of arrays

List of RSS feed names on which the delivery should be made visible.

Responses

Request samples

Content type
application/json
[
  • 10,
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Set syndicated state

List of RSS feed names on which the delivery is still visible.

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

archive
Array of arrays

List of RSS feed names on which the delivery should be visible. The delivery will be hidden from all RSS feed names not included in this parameter.

ingress
string

Ingress for item in RSS.

Responses

Request samples

Content type
application/json
[
  • 10,
  • [
    ],
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Mailinglists

Add external ID to mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

external_id
string

Mailinglist external ID.

external_id_type
string

Mailinglist external ID type.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "abc123",
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Create mailinglist

Request Body schema: application/json
name
required
string

Mailinglist name.

description
string

A short description of mailinglist.

self_service
boolean

Controls whether the list is available for subscription from a subscription site.

condition
string

Dynamic list specific expression for querying recipients in a mailing list.

Note: this needs to be null for regular and segment lists.

Condition name can be any recipient property. Condition can be one of following: not equal: <>, equal: =, like: ilike, not like: ilike-not, in list: in, begins: begins, not begins: begins-not, ends: ends, not ends: ends-not. For regular mailinglist this should be null.

site
string

Domain name of subscription site to add list for. Needs self-service to be true. See sites for listing sites.

cem_segment
integer

If list is connected to an Automation segment, the segment ID comes here. -1 if segment is not determined.

Note: this needs to be null for regular and dynamic lists.

ext_id
string

Mailinglist external ID.

ext_id_type
string

Mailinglist external ID type.

Responses

Request samples

Content type
application/json
[
  • "Sample list",
  • "Description text",
  • false,
  • "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }",
  • "site-domain",
  • null,
  • "abc123",
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 60
}

Delete mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Delete mailinglist external ID

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

type
required
string

Mailinglist external ID type.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Edit mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

new_name
required
string

Mailinglist name.

new_description
required
string

A short description of mailinglist.

new_subs
boolean

Controls whether the list is available for subscription from a subscription site.

new_condition
string

Dynamic list specific expression for querying recipients in a mailing list.

Note: this needs to be null for regular and segment lists.

Condition name can be any recipient property. Condition can be one of following: not equal: <>, equal: =, like: ilike, not like: ilike-not, in list: in, begins: begins, not begins: begins-not, ends: ends, not ends: ends-not. For regular mailinglist this should be null.

new_site
string

Domain name of subscription site to add list for. Needs self-service to be true. See sites for listing sites.

new_cem_segment
integer

If list is connected to an Automation segment, the segment ID comes here. -1 if segment is not determined.

Note: this needs to be null for regular and dynamic lists.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "Sample list",
  • "Description text",
  • false,
  • "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }",
  • "site-domain",
  • 13
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 60
}

Edit mailinglist condition

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

new_condition
string

Dynamic list specific expression for querying recipients in a mailing list.

Note: this needs to be null for regular and segment lists.

Condition name can be any recipient property. Condition can be one of following: not equal: <>, equal: =, like: ilike, not like: ilike-not, in list: in, begins: begins, not begins: begins-not, ends: ends, not ends: ends-not. For regular mailinglist this should be null.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }"
}

Edit mailinglist selfservice

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

self_service
boolean

Controls whether the list is available for subscription from a subscription site.

Responses

Request samples

Content type
application/json
[
  • 60,
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Find list by external ID

Request Body schema: application/json
list_external_id
required
string

Mailinglist external ID.

list_external_id_type
required
string

Mailinglist external ID type.

Responses

Request samples

Content type
application/json
[
  • "abc123",
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 60
}

Get import log

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

base64encoded
boolean

If set to true result will be Base64 encoded.

Responses

Request samples

Content type
application/json
[
  • 60,
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "Import summary:\n 1 records imported to listname\n\nDetails:\n Source CSV file had 2 lines\n New records: 1\n Updated records: 0\n Duplicates: 0\n Empty email or SMS: 0\n Rejected: 0\n Unsubscribed: 0\n Deleted: 0\n Domain rejected: 0\n Member limit exceeded: 0\n Target list: lista\n Import took 0 s\n\nCancelled subscriptions:\n None\n\nDeleted subscribers:\n None\n\nDomain rejected records:\n All OK\n\nMember limit exceeded records:\n None\n\nRejected records:\n All OK\n\nErrors:\n No errors\n"
}

Get mailinglist import status

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": -1
}

Get mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

get_sms_count
boolean

Include count of members with SMS numbers.

Responses

Request samples

Content type
application/json
[
  • 60,
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get mailinglist condition

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }"
}

Get mailinglist external ID

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

list_external_id_type
required
string

Mailinglist external ID type.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "string"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "abc123"
}

Get mailinglist members

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

from
integer

Result offset

num
integer

Number of entries to return. 0 for all entries.

order
string

Property by which the list is ordered by.

sort
string

Sort direction. asc or desc. Defaults to asc.

filter
string

Filter by string. Can be email, sms (with country code) or value of other property which has to fully match. Special filters:

  • has_email return recipients who have email set
  • has_sms return recipients who have sms set

Responses

Request samples

Content type
application/json
[
  • 60,
  • 100,
  • 0,
  • "email",
  • "desc",
  • "property-value"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get mailinglist members by condition

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

from
integer

Start date for query in epoch format. Ignored when used with new condition.

to
integer

End date for query in epoch format. Ignored when used with new condition.

condition
string
Enum: "bounced" "unsubscribed" "left" "joined" "new"
  • bounced members with bounces
  • unsubscribed members who have been on list but unsubscribed
  • left members who have opted out from list
  • joined members who have opted in to list
  • new all list members
cols
Array of arrays

If empty then get all properties or specify properties to get.

Responses

Request samples

Content type
application/json
[
  • 60,
  • 1573120800,
  • 1573207200,
  • "bounced",
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "\"email\";\"sms\";\"property\""
}

Get mailinglist member count

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 4012
}

Get mailinglists

Import statistics are returned if list import is in progress or queue.

Request Body schema: application/json
include_deleted
integer

If 1, deleted mailinglists will be returned along with existing.

Responses

Request samples

Content type
application/json
[
  • 1
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Hide mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Import CSV to mailinglist

For importing multiple contacts in CSV format. When importing large quantities it is recommended to split imports into batches (of 10k for example) and import them one by one. Function getImportStatus can be used to monitor import status. Property name restrictions apply here.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

properties_client
required
string

Deprecated, set to null.

csv
required
string

CSV data in raw or Base64 encoded format. Use:

  • Field separator ;
  • Encapsulation "
  • Encoding UTF-8
  • Unix style line endings \n
receipt
string

Deprecated, set to null.

base64_encoded
boolean

Data is Base64 encoded. Defaults to false.

truncate
boolean

Truncate list before import. Defaults to false.

disable_cem_events
boolean

Do not create any events for LianaAutomation from import. Defaults to false.

use_list_props
boolean

Wether to import the properties as default values or list specific values. Defaults to false.

use_duplicates
boolean

Use duplicate entries and put both into the list. Defaults to false.

fork
string

Deprecated, set to null.

user_id
integer

User associated with import. Optional identifier. Defaults to null.

import_id
integer

Import specific ID. To be given if specific import ID is to be used. Defaults to null.

consent_id
integer

Consent ID.

consent_lang
string

Consent language.

Responses

Request samples

Content type
application/json
[
  • 60,
  • null,
  • "string",
  • null,
  • false,
  • false,
  • false,
  • false,
  • false,
  • null,
  • null,
  • 123,
  • 4,
  • "EN"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Import JSON to mailinglist

For importing multiple contacts in JSON format. When importing large quantities it is recommended to split imports into batches (of 10k for example) and import them one by one. Function getImportStatus can be used to monitor import status. Property name restrictions apply here.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

emails
required
string

List in JSON format. Can be either simply list of email strings or list of objects cotaining email, sms, and property values. In this case all properties should be given in exact same order for every recipient object since values are mapped to properties in order they are given for first recipient.

Responses

Request samples

Content type
application/json
[
  • 60,
  • "[{\"email\":\"recipient1@example.com\",\"sms\":\"+35812345678\",\"property1\":\"value1\",\"property2\":\"value2\"},{\"email\":\"recipient2@example.com\",\"sms\":\"+35823456789\",\"property1\":\"value1\",\"property2\":\"value2\"}]"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": true
}

Is importing CSV to mailinglist allowed

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

properties_client
string

Deprecated, set to null.

csv
required
string

CSV data in raw or Base64 encoded format. Use:

  • Field separator ;
  • Encapsulation "
  • Encoding UTF-8
  • Unix style line endings \n
receipt
string

Deprecated, set to null.

base64_encoded
boolean

Data is Base64 encoded. Defaults to false.

truncate
boolean

Truncate list before import. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • 60,
  • null,
  • "string",
  • null,
  • false,
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "email\nrecipient@bad.domain\n"
}

Request targetgroup

Gets a dynamic mailing lists target group and adds target group members to the mailinglist.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "H:ws2-beta:231124"
}

Truncate mailinglist

This removes all active subscribers. Truncating a mailing list wont affect subscribers who have removed themselves from the list -- truncating and adding them back wont work. This is to safeguard unsubscribed recipients from being accidentally imported back to the list, e.g. from external systems.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Update mailinglist health

Accepts ID or an array of IDs as input value. Returns key-value array with list ID as key and updated health as value.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

Responses

Request samples

Content type
application/json
[
  • 60
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Members

Add member a consent

Request Body schema: application/json
member_id
required
integer

Recipient ID.

consent_id
required
integer

Consent ID.

consent_revision
required
integer

Consent revision.

lang
required
string

Consent language.

source
required
string

Source of action. REST API users should put api to this.

source_data
string

Free text field describing source.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • 4,
  • 2,
  • "EN",
  • "api",
  • "example.com/subscribe"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 4
}

Check emails for allowed domains

Request Body schema: application/json
recipients
required
Array of arrays

Array of recipient emails.

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": true
}

Confirm recipient

Request Body schema: application/json
code
required
string

Recipient confirmation code.

reason
string

Textual reason for recipient confirmation.

origin
string

Origin of confirmation, for example subscription page URL.

Responses

Request samples

Content type
application/json
[
  • "bdeCyBcrkf",
  • "Example reason.",
  • "example.com/subscription"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Create or update recipient

Add new recipient to mailinglist or update existing one. ID, email and SMS are used to find existing recipient, one of these must be given. Property name restrictions apply here.

Request Body schema: application/json
id
integer

Recipient ID.

email
string

Recipient email.

sms
string

Recipient SMS.

object

Recipient properties.

autoconfirm
boolean

If true, the recipient will be confirmed as valid automatically. Defaults to false.

reason
string

Reason for creation.

origin
string

Origin of action, eg. subscription page url or api.

lists
Array of integers

Array of mailinglists to join.

admin
boolean

Was the action initiated by admin. If set to false it is handled as it was initiated by recipient causing it to be for example listed in subscription statistics. Defaults to true.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "recipient@example.com",
  • "+358401234567",
  • {
    },
  • true,
  • "Example reason.",
  • "api",
  • [
    ],
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Create property

Request Body schema: application/json
name
string

Property name.

language
string

Property language.

type
string
Enum: "text" "numeric" "select" "checkbox"

Property type. Defaults to text.

choices
Array of arrays

Possible choices to select and checkbox type of properties.

required
boolean

Property is required on subscription page.

subscription
boolean

Property is visible on subscription page.

position
integer

Default position of property.

datatype
string
Enum: "text" "datetime" "numeric"

Data type of property. Defaults to text.

Responses

Request samples

Content type
application/json
[
  • "Example name",
  • "FI",
  • "select",
  • [
    ],
  • true,
  • true,
  • 1,
  • "text"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 123
}

Create recipient

Request Body schema: application/json
email
string

Recipient email.

sms
string

Recipient SMS.

object

Recipient properties.

autoconfirm
boolean

If true, the recipient will be confirmed as valid automatically. Defaults to false.

reason
string

Reason for creation.

origin
string

Origin of action, eg. subscription page url or api.

reactivate_bounced
boolean

If true, the recipient defined as unreachable due to bounces will be reactivated. Defaults to false.

Note! Email should only be activated if it is confirmed functional address. Abuse of the flag will lead to suspension of REST privileges.

Responses

Request samples

Content type
application/json
[
  • "recipient@example.com",
  • "+358401234567",
  • {
    },
  • true,
  • "Example reason.",
  • "api",
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Delete property

Request Body schema: application/json
name
required
string

Property name.

language
string

Property language.

Responses

Request samples

Content type
application/json
[
  • "Example name",
  • "EN"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Delete recipient

Request Body schema: application/json
id
integer

Recipient ID.

reason
string

Reason for deletion.

subscriber_reason_type
string

Recipient given reason type.

subscriber_reason_text
string

Recipient given reason free text.

origin
string

Origin of action, eg. subscription page url or api.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "Reason",
  • "Other",
  • "Custom reason here",
  • "api"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Edit recipient

Edit the recipient information. Email and sms fields must be given, even if they do not differ from the previous values. Only given properties are updated.

Request Body schema: application/json
id
required
integer

Recipient ID.

email
required
string

Recipient email.

sms
string

Recipient SMS.

object

Recipient properties.

reason
string

Textual reason for action.

origin
string

Origin of action, eg. subscription page url or api.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "recipient@example.com",
  • "+358401234567",
  • {
    },
  • "Example reason.",
  • "api"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Enable recipient

Request Body schema: application/json
id
required
integer

Recipient ID.

reason
string

Textual reason for action.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "Example reason."
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Recipient exists

Request Body schema: application/json
email or sms
required
string

Recipient email address or SMS number.

Responses

Request samples

Content type
application/json
[
  • "+358123456789"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Find recipients by property

Returns list of recipients which have specified value on specified property.

Request Body schema: application/json
property_id
required
integer

Property handle. See getCustomerProperties.

property_value
required
integer

Property value.

limit
integer

Max number of matching recipients returned. Defaults to 1.

offset
integer

Offset for limit (e.g. for pagination). Defaults to 0.

Responses

Request samples

Content type
application/json
[
  • 123,
  • "property_value",
  • 2,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Forget recipient

GDPR forget-me compliant subscriber erasure.

Request Body schema: application/json
id
required
integer

Recipient ID.

reason
string

Textual reason for action.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "Example reason."
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Forget recipient by email

GDPR forget-me compliant subscriber erasure.

Request Body schema: application/json
email
required
string

Recipient email.

reason
string

Textual reason for action.

Responses

Request samples

Content type
application/json
[
  • "recipient-to-forget@example.com",
  • "Example reason."
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Forget recipient by SMS

GDPR forget-me compliant subscriber erasure.

Request Body schema: application/json
sms
required
string

Recipient SMS.

reason
string

Textual reason for action.

Responses

Request samples

Content type
application/json
[
  • "+35812345678",
  • "Example reason."
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Get clickers

Get clickers filtered starting from parameter.

Request Body schema: application/json
from
required
string

Start from date

offset
integer

Result offset

Responses

Request samples

Content type
application/json
[
  • "2019-12-20 14:00:00",
  • 100
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get properties

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get deleted recipient

Request Body schema: application/json
id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get deleted recipients

Request Body schema: application/json
from
integer

Result offset

num
integer

How many

order
string

Property by which the list is ordered by.

sort
string

Sort direction. asc or desc. Defaults to asc.

filter
string

Filter by string.

Responses

Request samples

Content type
application/json
[
  • 100,
  • 100,
  • "email",
  • "desc",
  • "text"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get member consent updates

Fetch changes in GDPR compliant grounds for sending since given start date. Returns maximum of 1000 items per call.

Request Body schema: application/json
from_date
required
string

Start from date

offset
integer

Result offset

limit
integer

Result limit

object
consent_id
integer

Consent ID.

Responses

Request samples

Content type
application/json
[
  • "2020-01-10T01:00:00+0200",
  • 0,
  • 1000,
  • {
    },
  • 4
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipient

Request Body schema: application/json
id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipient by email

Request Body schema: application/json
email
required
string

Recipient email.

include_deleted
boolean

Include deleted in results. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • "recipient@example.com",
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipient by sms

Request Body schema: application/json
sms
required
string

Recipient SMS.

include_deleted
boolean

Include deleted in results. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • "+358401234567",
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipient confirmation code

Request Body schema: application/json
id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "bdeCyBcrkf"
}

Get recipient data in file

Get recipient GDPR data in file.

Request Body schema: application/json
id
required
integer

Recipient ID.

required
object

Responses

Request samples

Content type
application/json
[]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "string"
}

Get recipient history

Request Body schema: application/json
id
required
integer

Recipient ID.

limit
integer

Maximum number of mails to get, zero for all.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get recipient list

Request Body schema: application/json
ids
Array of arrays

Array of recipient IDs.

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get recipients

Request Body schema: application/json
from
integer

Result offset

num
integer

How many

order
string

Property by which the list is ordered by.

sort
string

Sort direction. asc or desc. Defaults to asc.

filter
string

Filter by string.

Responses

Request samples

Content type
application/json
[
  • 100,
  • 100,
  • "email",
  • "desc",
  • "text"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get recipients list properties

Get recipients mailing list related properties.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

recipient_id
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 60,
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipients stats

Maximum of 1000 recipients at once.

Request Body schema: application/json
recipient_ids
Array of arrays

Array of recipient IDs.

values
Array of strings
Items Enum: "opens" "clicks"

Type of stats to get.

Responses

Request samples

Content type
application/json
[
  • [
    ],
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get recipients statuses

Request Body schema: application/json
recipient_ids
Array of arrays

Array of recipient emails.

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get shadow recipient

Request Body schema: application/json
recipient_id
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get unassociated recipient count

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 120
}

Get unique recipient count

Get unique message recipients based on list IDs and adhoc email addresses

Request Body schema: application/json
lists
Array of arrays

Array of list IDs.

adhocs
Array of arrays

Array of adhoc email addresses.

Responses

Request samples

Content type
application/json
[
  • [
    ],
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 421
}

Get unsubscriptions

Get unsubscriptions from lists. This is not to be confused with marketing ban or disabled recipients. A recipient can still be active in other lists even if it has been unsubscribed from some other list.

Request Body schema: application/json
from_date
string

Start from date

Responses

Request samples

Content type
application/json
[
  • "2019-12-20"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Is recipient enabled

Request Body schema: application/json
required
integer or string

Email, SMS or ID of recipient.

strict
boolean

Inverted return values.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Join recipients to mailinglist

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

recipient_list
required
Array of arrays

List of recipient IDs.

noauto
boolean

Set to true to avoid automatically confirming the recipient. Defaults to false.

reason
string

Textual reason for action.

admin
boolean

Was the action initiated by admin true or user false. Defaults to true.

truncate
boolean

Truncate list before import. Defaults to false.

origin
string

Origin of action, eg. subscription page url or api.

rejoin
boolean

Rejoin to list (enables repeatable welcome messages). Defaults to false.

ignore_errors
boolean

Ignore errors about missing recipients. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • 60,
  • [
    ],
  • true,
  • "Example reason.",
  • false,
  • false,
  • "api",
  • true,
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Get recipient action history

Get history of member actions. Call memberHistoryUpdate before this for new data.

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

object

Responses

Request samples

Content type
application/json
[
  • 20000,
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Update recipient action history

Trigger member history updating. memberHistoryUpdateStatus can be called for state of this transaction.

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Get recipient history update status

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 0
}

Query recipients by function

Returns array of recipient IDs. Last item of result array is count of recipients.

Request Body schema: application/json
function
string
Enum: "filterRecipients" "getMailingListMembers" "getRecipients" "getRecipientsReceivedMessage" "getRecipientsActive" "getUnassociatedRecipients" "getDeletedRecipients" "getBounceDeletedRecipients"

Method to query recipients with.

list_id
integer

Mailinglist ID.

offset
integer

Result offset

number
integer

How many

order
string

Property by which the list is ordered by.

sort
string

Sort direction. asc or desc. Defaults to asc.

filter
string

Filter by string.

csv
boolean

If result is wanted as CSV data. Defaults to false.

gzip
boolean

If CSV data is gzipped. Data will be returned as Base64. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • "getRecipients",
  • 60,
  • 100,
  • 100,
  • "email",
  • "desc",
  • "text",
  • true,
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Leave mailinglist

This method works only for static members, and should be considered deprecated. Use removeRecipientFromMailingList instead: It works for both dynamic and static recipients.

Request Body schema: application/json
list_id
required
integer

Mailinglist ID.

recipient_id
required
integer

Recipient ID.

reason
string

Textual reason for action.

admin
boolean

Was the action initiated by admin true or user false. Defaults to true.

origin
string

Origin of action, eg. subscription page url or api.

Responses

Request samples

Content type
application/json
[
  • 60,
  • 20000,
  • "Example reason.",
  • false,
  • "api"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Reactivate recipient

Request Body schema: application/json
email
required
string

Recipient email.

identity
required
string

Identifying information for the person/entity doing the reactivation.

reason
required
string

Textual reason for action.

confirm
boolean

If true, the recipient will be confirmed as valid automatically. Defaults to false.

rise
string

Deprecated, set to null.

origin
string

Origin of action, eg. subscription page url or api.

object

Recipient properties.

Responses

Request samples

Content type
application/json
[
  • "recipient@example.com",
  • "Admin user.",
  • "Example reason.",
  • true,
  • null,
  • "api",
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Remove from mailinglist

If the member and list parameters are given, the member is removed from the said list. If only the member is given, and list is zero, then the member is removed form all lists where they are currently active.

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

list_id
required
integer

Mailinglist ID.

reason
string

Textual reason for action.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • 60,
  • "Example reason."
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": true
}

Rename property

Request Body schema: application/json
old_name
required
string

Existing property name.

new_name
required
string

New property name.

language
required
string

Property language.

Responses

Request samples

Content type
application/json
[
  • "Old name",
  • "New name",
  • "EN"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Request member history update

memberHistoryUpdateStatus can be called for state of this transaction.

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "H:mailer:50$20a471d4e47d950609d3d38c92b487c3"
}

Revoke consent

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

consent_id
required
integer

Consent ID.

consent_revision
required
integer

Consent revision.

consent_lang
required
string

Consent language.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • 4,
  • 2,
  • "EN"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": null
}

Send confirmation email

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

required
object

Responses

Request samples

Content type
application/json
[
  • 20000,
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Send welcome mail

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

site
required
string

Domain name of subscription site to add list for. Needs self-service to be true. See sites for listing sites.

force
integer

Set to false or 0 to prevent sending of welcome mail to recipient who already received one. Defaults to true.

props
object

Key-value pair array of properties for the message.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "site-domain",
  • false,
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Set confirmation code

Generate and set confirmation code for recipient.

Request Body schema: application/json
recipient_id
required
integer

Recipient ID.

Responses

Request samples

Content type
application/json
[
  • 20000
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "bdeCyBcrkf"
}

Update recipient

Update recipient information. You may only provide updated values. Note that unsetting values is not possible. For convenience, you may create recipient if it does not exist by giving create flag. Property name restrictions apply here.

Request Body schema: application/json
recipient_email
required
string

Recipient email.

recipient_sms
string

Recipient SMS.

object

Recipient properties.

reason
string

Textual reason for action.

origin
string

Origin of action, eg. subscription page url or api.

create
boolean

Wether to create recipient if it does not exist. Defaults to false.

Responses

Request samples

Content type
application/json
[
  • "recipient@example.com",
  • "+358401234567",
  • {
    },
  • "Example reason.",
  • "api",
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 20000
}

Reports

Get archived deliveries

Request Body schema: application/json
archive
required
string

Archive name.

number
required
integer

How many

order
required
integer

Change output order. 2 for ascending. Descending by default.

Responses

Request samples

Content type
application/json
[
  • "Archive",
  • 100,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get deliveries

Request Body schema: application/json
delivery_ids
Array of integers

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get deliveries range

Request Body schema: application/json
string or integer

Search start date if date given or offset if integer.

string or integer

Search end date if date given or max number of results if integer.

sort
string
Enum: "created" "subject" "id" "members" "bounced" "campaign" "list_id" "scheduled"

Property by which the list is ordered by. DESC, ASC can be added to control output further.

Responses

Request samples

Content type
application/json
[
  • "2019-12-20",
  • 100,
  • "created ASC"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get deliveries range CSV

Request Body schema: application/json
string or integer

Search start date if date given or offset if integer.

string or integer

Search end date if date given or max number of results if integer.

sort
string
Enum: "created" "subject" "id" "members" "bounced" "campaign" "list_id" "scheduled"

Property by which the list is ordered by. DESC, ASC can be added to control output further.

Responses

Request samples

Content type
application/json
[
  • "2019-12-20",
  • 100,
  • "created ASC"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "\"id\";\"mail_id\";\"owner\";\"members\";\"delivered\";\"bounced\";\"created\";\"scheduled\";\"subject\";\"clicks\";\"clickers\";\"opens\";\"openers\";\"noopeners\";\"list_id\";\"list_name\";\"list_deleted\";\"list_hidden\";\"archive\";\"rss\";\"html\";\"plain\";\"campaign\";\"smscount\";\"excluded\";\"unsubscribed\";\"direct_unsubscriptions\";\"direct_subscriptions\";\"done\";\"smsreceived\";\"type\";\"user_id\";\"user_display_name\";\"tags\";"
}

Get delivery members conditionally CSV

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

condition
string
Enum: "openers" "smsreceived" "noopeners" "clickers" "bounced" "unsubscribed" "delivered" "undelivered" "success" "bad" "excluded" "direct_unsubscriptions" "direct_subscriptions" "tafclickers" "tafsent" "tafsubscriptions" "taflinkclickers"

Condition

translations
object

User defined translations for result headers.

extra
integer

Optional extra parameter for clickers condition. Pass link ID as string or integer to get clicker data for specific link.

Responses

Request samples

Content type
application/json
[
  • 10,
  • "clickers",
  • {
    },
  • 12
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "\"email\";\"sms\";\"format\";\"extra\";\"prop\""
}

Get delivery members conditionally

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

condition
string
Enum: "openers" "smsreceived" "noopeners" "clickers" "bounced" "unsubscribed" "delivered" "undelivered" "success" "bad" "excluded" "direct_unsubscriptions" "direct_subscriptions" "tafclickers" "tafsent" "tafsubscriptions" "taflinkclickers"

Condition

translations
object

User defined translations for result headers.

extra
integer

Optional extra parameter for clickers condition. Pass link ID as string or integer to get clicker data for specific link.

Responses

Request samples

Content type
application/json
[
  • 10,
  • "clickers",
  • {
    },
  • 12
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get delivery members conditionally with time

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

condition
string
Enum: "openers" "smsreceived" "noopeners" "clickers" "bounced" "unsubscribed" "delivered" "undelivered" "success" "bad" "excluded" "direct_unsubscriptions" "direct_subscriptions" "tafclickers" "tafsent" "tafsubscriptions" "taflinkclickers"

Condition

extra
string

Optional extra parameter for clickers condition. Pass one or multiple link IDs as comma separated string to get clicker data for specific link(s).

Responses

Request samples

Content type
application/json
[
  • 10,
  • "clickers",
  • "104,106"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "\"email\";\"sms\";\"date\";\"format\";\"extra1\";\"extra2\""
}

Get delivery report

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

Responses

Request samples

Content type
application/json
[
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get delivery size

Request Body schema: application/json
delivery_id
required
integer

Delivery ID.

inline_only
integer

Whether to count only embedded resources, like inline images and inline attachments. Defaults to 1.

Responses

Request samples

Content type
application/json
[
  • 10,
  • 1
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 35490
}

Get delivery statuses

Request Body schema: application/json
deliveries
required
Array of arrays

Delivery IDs.

Responses

Request samples

Content type
application/json
[
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get automation deliveries

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get mail template

Request Body schema: application/json
id
required
integer

Mail ID.

encode
boolean

If set to true result will be Base64 encoded.

Responses

Request samples

Content type
application/json
[
  • 20,
  • false
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Get archived deliveries

Request Body schema: application/json
archive
required
string

Archive name.

num
required
integer

How many

order
integer

Change output order. 2 for ascending. Descending by default.

Responses

Request samples

Content type
application/json
[
  • "Archive",
  • 100,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get tracking link info

Request Body schema: application/json
id
required
integer

Link ID.

summary
integer

If set to 1, will return link summary instead of individual clicks. Defaults to 0.

Responses

Request samples

Content type
application/json
[
  • 600,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get opening track info

Request Body schema: application/json
id
required
integer

Delivery ID.

opened
integer

Fetch openers 1, or non-openers 0. Defaults to 1.

Responses

Request samples

Content type
application/json
[
  • 10,
  • 0
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Sites

Get default domain postfix

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "postfix.com"
}

Get postfixes

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get site

Request Body schema: application/json
domain
required
string

Site domain name.

Responses

Request samples

Content type
application/json
[
  • "site-domain"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Create site

Request Body schema: application/json
domain
required
string

Site domain name.

object

Responses

Request samples

Content type
application/json
[
  • "site-domain",
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "site-domain"
}

Delete site

Request Body schema: application/json
domain
required
string

Site domain name.

Responses

Request samples

Content type
application/json
[
  • "site-domain"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": true
}

Update site

Request Body schema: application/json
domain
required
string

Site domain name.

object

Responses

Request samples

Content type
application/json
[
  • "site-domain",
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": true
}

Get sites

Request Body schema: application/json
object

Return layout and property data (refaults to true).

object

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Statistics

Get deliverability ratings

Request Body schema: application/json
count
integer

Number of entries to return for call. Must be 100 or less. Defaults to 1.

offset
integer

Offset for result. Defaults to 0.

Responses

Request samples

Content type
application/json
[
  • 20,
  • 10
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get statistics

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

System

Add confirmation task

Add task which is to be run upon clicking of confirmation link on welcome message, or by calling confirmRecipient.

Request Body schema: application/json
member_id
required
integer

Recipient ID.

confirmation_code
required
string

Recipient confirmation code.

task_type
required
string
Enum: "consent" "membership" "properties"

Type of confirmation task.

required
object

Contents of task, depending on task type given.

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "bdeCyBcrkf",
  • "membership",
  • {
    }
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Add confirmation tasks

Add tasks which are to be run upon clicking of confirmation link on welcome message, or by calling confirmRecipient.

Request Body schema: application/json
member_id
required
integer

Recipient ID.

confirmation_code
required
string

Recipient confirmation code.

required
Array of objects

Responses

Request samples

Content type
application/json
[
  • 20000,
  • "bdeCyBcrkf",
  • [
    ]
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Create consent type

Request Body schema: application/json
name
required
string

Name of consent type.

is_revokable
required
boolean

Consent revokable state.

Responses

Request samples

Content type
application/json
[
  • "type",
  • true
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 4
}

Delete consent type

Request Body schema: application/json
consent_id
required
integer

Consent ID.

Responses

Request samples

Content type
application/json
[
  • 4
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Echo

Request Body schema: application/json
msg
string

Echo message.

Responses

Request samples

Content type
application/json
[
  • "echo"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": "echo"
}

Edit consent translation

Request Body schema: application/json
consent_id
required
integer

Consent ID.

lang
required
string

Consent language.

title
required
string

Consent title.

description
required
string

Consent description.

Responses

Request samples

Content type
application/json
[
  • 4,
  • "EN",
  • "Example title",
  • "Example description"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 2
}

Edit consent type

Request Body schema: application/json
consent_id
required
integer

Consent ID.

name
required
string

Name of consent type.

is_revokable
required
integer

Consent revision.

Responses

Request samples

Content type
application/json
[
  • 4,
  • "type",
  • 2
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": 1
}

Get confirmation tasks

Request Body schema: application/json
confirmation_code
required
string

Recipient confirmation code.

Responses

Request samples

Content type
application/json
[
  • "bdeCyBcrkf"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get consent types

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get consent types by site

Request Body schema: application/json
site
required
string

Domain name of subscription site to add list for. Needs self-service to be true. See sites for listing sites.

Responses

Request samples

Content type
application/json
[
  • "site-domain"
]

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": [
    ]
}

Get server details

Responses

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Pingpong

Pingpong

Request Body schema: application/json
optional
ping
string

Optional parameter.

Responses

Request samples

Content type
application/json
{
  • "ping": "ping"
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Deliveries

Send event or transactional mail

Event send endpoint is used mainly for delivering single personal emails. Please use batch send endpoint for creating email deliveries for larger recipient groups. For transactional email deliveries, you should have a dedicated LianaMailer account for deliverability reasons. Please contact your Liana Account Manager in order to get the transactional email feature activated.

Request Body schema: application/json
required
required
object
recipients
required
Array of arrays

List of recipients.

tracking_id
string

Optional user defined tracking id for event delivery. If not set, one will be generated by system. Must be 10-24 characters of length and contain only lowercase letters a-z and numbers 0-9.

Responses

Request samples

Content type
application/json
{
  • "letter": {
    },
  • "recipients": [
    ],
  • "tracking_id": "customabc123"
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Batch send

Each recipient will receive the mail only once, even if the recipient is on multiple mailing lists. Return value contains information about the batch-send event, including created delivery IDs and mail IDs.

Request Body schema: application/json
required
required
object
recipients
Array of arrays

List of recipients.

lists
Array of arrays

List of mailing lists. Can be omitted if recipients is set and vice versa. Set this parameter if you wish to send mail to multiple mailing lists. Note that you can set both recipients and lists.

Responses

Request samples

Content type
application/json
{
  • "letter": {
    },
  • "recipients": [
    ],
  • "lists": [
    ]
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Send webpage

Each recipient will receive the mail only once, even if the recipient is on multiple mailing lists. Return value contains information about the webpage-send event, including created delivery IDs and mail IDs.

Request Body schema: application/json
required
required
object
recipients
Array of arrays

List of recipients.

lists
Array of arrays

List of mailing lists. Can be omitted if recipients is set and vice versa. Set this parameter if you wish to send mail to multiple mailing lists. Note that you can set both recipients and lists.

Responses

Request samples

Content type
application/json
{
  • "letter": {
    },
  • "recipients": [
    ],
  • "lists": [
    ]
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Import

Import mailinglist

For importing multiple contacts. When importing large quantities it is recommended to split imports into batches (of 10k for example) and import them one by one. Function getImportStatus can be used to monitor import status. Property name restrictions apply here.

Request Body schema: application/json
required
list_id
required
integer

Mailinglist ID if importing to existing list. Required if name is omitted.

name
required
string

Mailinglist name. Required if list_id is omitted.

  • If used without list_id creates a new list if list with same name in same folder does not exist.
  • If used together with list_id, updates list name.
data
required
string

List contents Base64 encoded.

type
required
string

Input format (csv/xls). If csv, use:

  • Field separator ;
  • Encapsulation "
  • Encoding UTF-8
  • Unix style line endings \n
folder
string

Mailinglist folder path. Created if does not exist. Supports multi level folders.

If used together with list_id:

  • Moves list to given folder.
  • Giving empty string or omitting, wont do any changes in list folder.
  • Giving / will move list to root folder.

If used when list_id is not given:

  • Will import to list by same name in same folder or creates new if one is not found.
  • Giving empty string or / creates list or imports to list in root folder.
truncate
boolean

Truncate mailinglist before importing. Defaults to false.

consent_id
integer

ID of consent to be given to imported contacts. Required if consent is to be given.

consent_lang
string

Language of consent to be given to imported contacts. Required if consent is to be given.

Responses

Request samples

Content type
application/json
{
  • "list_id": 101,
  • "name": "The does",
  • "data": "ImVtYWlsIjsiZmlyc3RuY...",
  • "type": "csv",
  • "folder": "Example",
  • "truncate": true,
  • "consent_id": 4,
  • "consent_lang": "EN"
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "result": {
    }
}

Delivery reports

Get delivery openers

path Parameters
delivery_id
required
integer

Delivery ID.

query Parameters
limit
integer >= 1
Default: 20
Example: limit=30

The number of items to return. Default is 20.

offset
integer >= 0

The number of items to skip.

fields
string
Example: fields=id,href

Fields to include in the response. Default fields: id, href, event

properties
Array of strings

Example: properties[0]=firstname&properties[1]=lastname
Include the listed recipient properties in the result. By default, doesn't return any properties and the properties object is set to null in the response.

sort
string
Example: sort=-event.at

Sortable fields: id, event.at. Prepend the field with - for descending or optionally + for ascending order. Defaults to -event.at.

event_at_start
string <date-time>
Example: event_at_start=2017-01-01T01:01:01

Return only events created after the given date(time). Should be given in Europe/Helsinki time.

Responses

Request samples

require 'php/RestClient.php';

$client = new LianaTech\RestClient(
  <USER ID>,
  '<SECRET KEY>',
  '<API_URL>',
  3,
  '<REALM>'
);

try {
  $res = $client->call(
    'deliveries/123/openers',
    array(),
    'GET'
  );
}
catch (LianaTech\RestClientAuthorizationException $e) {
  echo "ERROR: Authorization failed";
}
catch (exception $e)  {
  echo "ERROR: " . $e->getmessage() . "";
}

Response samples

Content type
application/json
{}

Get delivery clickers

path Parameters
delivery_id
required
integer

Delivery ID.

query Parameters
limit
integer >= 1
Default: 20
Example: limit=30

The number of items to return. Default is 20.

offset
integer >= 0

The number of items to skip.

fields
string
Example: fields=id,href

Fields to include in the response. Default fields: id, href, event

properties
Array of strings

Example: properties[0]=firstname&properties[1]=lastname
Include the listed recipient properties in the result. By default, doesn't return any properties and the properties object is set to null in the response.

sort
string
Example: sort=-event.at

Sortable fields: id, event.at. Prepend the field with - for descending or optionally + for ascending order. Defaults to -event.at.

event_at_start
string <date-time>
Example: event_at_start=2017-01-01T01:01:01

Return only events created after the given date(time). Should be given in Europe/Helsinki time.

Responses

Request samples

require 'php/RestClient.php';

$client = new LianaTech\RestClient(
  <USER ID>,
  '<SECRET KEY>',
  '<API_URL>',
  3,
  '<REALM>'
);

try {
  $res = $client->call(
    'deliveries/123/clickers',
    array(),
    'GET'
  );
}
catch (LianaTech\RestClientAuthorizationException $e) {
  echo "ERROR: Authorization failed";
}
catch (exception $e)  {
  echo "ERROR: " . $e->getmessage() . "";
}

Response samples

Content type
application/json
{}

Events

Get all events

query Parameters
limit
integer >= 1
Default: 20
Example: limit=30

The number of items to return. Default is 20.

offset
integer >= 0

The number of items to skip.

properties
Array of strings

Example: properties[0]=firstname&properties[1]=lastname
Include the listed recipient properties in the result. By default, doesn't return any properties and the properties object is set to null in the response.

type
string
Enum: "confirmed" "created" "data-change" "deleted" "list-join" "list-quit" "mailbounce" "maillink" "mailopen" "mailsent" "reactivated"

Get only events of this type. Accepts only a single type. Possible values are confirmed, created, data-change, deleted, list-join, list-quit, mailbounce, maillink, mailopen, mailsent, reactivated. Returns all types of events if not specified.

sort
string
Example: sort=-at

Sortable field: at. Prepend the field with - for descending or optionally + for ascending order.

at_start
string <date-time>
Example: at_start=2017-01-01T01:01:01

Return only events created after the given date(time). Should be given in Europe/Helsinki time.

at_end
string <date-time>
Example: at_end=2017-01-01T01:01:01

Return only events created before the given date(time). Should be given in Europe/Helsinki time.

list_data
boolean

If set to true, include list object in response filled with list data if such is available. Default values is false.

Responses

Request samples

require 'php/RestClient.php';

$client = new LianaTech\RestClient(
  <USER ID>,
  '<SECRET KEY>',
  '<API_URL>',
  3,
  '<REALM>'
);

try {
  $res = $client->call(
    'events?type=mailopen&limit=10&at_start=2020-01-01T12:00:00',
    array(),
    'GET'
  );
}
catch (LianaTech\RestClientAuthorizationException $e) {
  echo "ERROR: Authorization failed";
}
catch (exception $e)  {
  echo "ERROR: " . $e->getmessage() . "";
}

Response samples

Content type
application/json
{}