Open source REST client can be found at github.
Most code examples use client for constructing the message including headers and authenticating.
Headers to include in request (case sensitive):
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)
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:
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.
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
While making requests to different API versions it should be kept in mind that parameters work a bit differently in different versions.
This is a collection of some common use cases and examples on how to complete them using LianaMailer REST API.
In this case we have a list of contacts to which we want to send a newsletter.
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";
<?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.
In this example we fetch tracking events from v3/events endpoint.
Parameters used here are:
mailopen
<?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 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.).
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>'
);
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$',
);
{- "succeed": true,
- "result": {
- "id": 2001,
- "site": "default.domain",
- "language": "EN",
- "unsubscribe": true,
- "subscribe": true,
- "rss": true,
- "archive": true,
- "tracking": true,
- "sms": true,
- "multiple_lists": true,
- "unsubscribe_is_final": true,
- "delete_on_bounce": true,
- "has_individuals": false,
- "has_companies": false,
- "tellafriend": true,
- "webpage": true,
- "registration_needs_confirmation": true,
- "archive_is_public": true,
- "shortmessage_provider": "dummy",
- "header_precedence": true,
- "sales_person_email": "salesperson@example.com",
- "cem": "LCUI",
- "shortmessage_account": "accountmane",
- "shortmessage_password": "password",
- "statistics": true,
- "mta": true,
- "dynamic_lists": true,
- "preview_props_overrides": false,
- "show_cem_deliveries": false,
- "show_draft_lang_select": true,
- "list_properties": true,
- "default_sms_country": "FI",
- "property_parser": "2016",
- "gdpr": true,
- "cem_tracking": false,
- "dp_officer_name": "name",
- "dp_officer_email": "email@example.com",
- "approval": false,
- "min_list_health": 80,
- "rss_template_engine": "PerItem"
}
}
{- "succeed": true,
- "result": {
- "domain": "example.domain",
- "owner": 1000,
- "language": "EN",
- "accep_check": false,
- "welcome": 12012,
- "ssl": true,
- "parent": "",
- "is_default": false,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": false,
- "whitelist_email": "sender@example.com",
- "redirect": "redirect.domain",
- "postfix": "mail-eur.net",
- "envelope_sender": false,
- "domain_aliases": "{domain.alias,another.domain.alias}",
- "recaptcha_secret": "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe",
- "emabed_notes": "Embedded at www.example.com",
- "embed_only": true,
- "replaced_by": "new.domain",
- "rename_to": "new.domain",
- "hidden": false,
- "created": "2019-10-20 11:10:22.125111+02",
- "has_csfr": true,
- "deny_framing": true,
- "site": "example.domain"
}
}
site | string Specific site name. If set to |
[- "example.site"
]
{- "succeed": true,
- "result": {
- "domain": "example.domain",
- "owner": 1000,
- "language": "EN",
- "accep_check": false,
- "welcome": 12012,
- "ssl": true,
- "parent": "",
- "is_default": false,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": false,
- "whitelist_email": "sender@example.com",
- "redirect": "redirect.domain",
- "postfix": "mail-eur.net",
- "envelope_sender": false,
- "domain_aliases": "{domain.alias,another.domain.alias}",
- "recaptcha_secret": "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe",
- "emabed_notes": "Embedded at www.example.com",
- "embed_only": true,
- "replaced_by": "new.domain",
- "rename_to": "new.domain",
- "hidden": false,
- "created": "2019-10-20 11:10:22.125111+02",
- "has_csfr": true,
- "deny_framing": true,
- "site": "example.domain"
}
}
{- "succeed": true,
- "result": [
- {
- "domain": "example.domain",
- "owner": 1000,
- "language": "EN",
- "accep_check": false,
- "welcome": 12012,
- "ssl": true,
- "parent": "",
- "is_default": false,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": false,
- "whitelist_email": "sender@example.com",
- "redirect": "redirect.domain",
- "postfix": "mail-eur.net",
- "envelope_sender": false,
- "domain_aliases": "{domain.alias,another.domain.alias}",
- "recaptcha_secret": "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe",
- "emabed_notes": "Embedded at www.example.com",
- "embed_only": true,
- "replaced_by": "new.domain",
- "rename_to": "new.domain",
- "hidden": false,
- "created": "2019-10-20 11:10:22.125111+02",
- "has_csfr": true,
- "deny_framing": true
}
]
}
[- {
- "properties": [
- "id",
- "email"
], - "deliveries": {
- "after": "2019-10-21T12:00:00"
}, - "lists": [
- 6,
- 14
], - "format": null
}
]
{- "succeed": true,
- "result": [
- {
- "id": 1001,
- "email": "recipient1@example.com"
}
]
}
[- "example.site"
]
{- "succeed": true,
- "result": {
- "domain": "example.domain",
- "owner": 1000,
- "language": "EN",
- "accep_check": false,
- "welcome": 12012,
- "ssl": true,
- "parent": "",
- "is_default": false,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": false,
- "whitelist_email": "sender@example.com",
- "redirect": "redirect.domain",
- "postfix": "mail-eur.net",
- "envelope_sender": false,
- "domain_aliases": "{domain.alias,another.domain.alias}",
- "recaptcha_secret": "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe",
- "emabed_notes": "Embedded at www.example.com",
- "embed_only": true,
- "replaced_by": "new.domain",
- "rename_to": "new.domain",
- "hidden": false,
- "created": "2019-10-20 11:10:22.125111+02",
- "has_csfr": true,
- "deny_framing": true,
- "site": "example.domain"
}
}
site required | string Site domain. |
language | string Site language. |
welcome | integer Site welcome message delivery ID. |
ssl | integer Site ssl usage flag. |
[- "new.site",
- "EN",
- 1,
- 1
]
{- "succeed": true,
- "result": "example.site"
}
site | string If existing site is to be modified, domain name. |
id required | integer This should be set to |
new_name | string New site domain name. |
language | string Site language. |
welcome | integer Site welcome message delivery ID. |
ssl | integer Site ssl flag |
[- "old.site",
- 0,
- "new.site",
- "EN",
- 1,
- 1
]
{- "succeed": true,
- "result": "new.site"
}
Attempts to cancel a pending delivery. If this fails, returns a soapfault error. In such case you can attempt a deleteDelivery.
delivery_id required | integer Delivery ID. |
[- 10
]
{- "succeed": true,
- "result": 1
}
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.
delivery_id required | integer Delivery ID. |
[- 10
]
{- "succeed": true,
- "result": 1
}
id | integer Delivery ID. If omitted will return all the deliveries. |
[- 10
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "mail_id": 20,
- "owner": 1,
- "members": 21,
- "delivered": 21,
- "bounced": 1,
- "created": "2020-01-15 14:55:00",
- "scheduled": "2020-01-18 10:00:00",
- "subject": "RXhhbXBsZSBzdWJqZWN0",
- "clicks": 2,
- "clickers": 36,
- "opens": 974,
- "openers": 974,
- "noopeners": 25,
- "list_id": 60,
- "list_name": "Example list",
- "list_deleted": null,
- "list_hidden": "2020-01-30 14:22:00",
- "archive": [
- "archive-name"
], - "rss": [
- "archive-name"
], - "html": "string",
- "plain": "string",
- "campaign": 5,
- "smscount": 412,
- "excluded": 33,
- "unsubscribed": 2,
- "direct_unsubscriptions": 1,
- "direct_subscriptions": 3,
- "done": 1,
- "smsreceived": 0,
- "type": "bulk",
- "user_id": 4000,
- "user_display_name": "Test Person",
- "tags": [
- "Tag1",
- "Tag2"
]
}
]
}
delivery_id required | integer Delivery ID. |
[- 10
]
{- "succeed": true,
- "result": [
- {
- "link_id": 600,
- "clicks": 2,
- "clickers": 7,
- "friend_clicks": 2
}
]
}
{- "succeed": true,
- "result": [
- {
- "link_id": 600,
- "clicks": 2,
- "clickers": 7,
- "friend_clicks": 2,
- "mail_id": 20,
- "converted": "$SYSTEM:SITE$/go/600-10",
- "checksum": 9
}
]
}
[- 20
]
{- "succeed": true,
- "result": [
- {
- "link_id": 600,
- "clicks": 2,
- "clickers": 7,
- "friend_clicks": 2
}
]
}
mail_id required | integer Mail ID. |
from | string Start from date |
[- 20,
- "2019-12-20 14:00:00"
]
{- "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"
}
mail_id required | integer Mail ID. |
from | string Start from date |
[- 20,
- "2019-12-20 14:00:00"
]
{- "succeed": true,
- "result": [
- {
- "opened_at": "2020-01-10 14:22:04",
- "useragent": "string",
- "acceptlanguage": "en-US,en;q=0.9,fi;q=0.8",
- "remote_addr": "127.0.0.1",
- "hostname": "string",
- "continent_code": "string",
- "org_name": "string",
- "country_code": "string",
- "country_code3": "string",
- "country_name": "string",
- "region": "string",
- "city": "string",
- "postal_code": "string",
- "latitude": "string",
- "longitude": "string",
- "dma_code": "string",
- "area_code": "string",
- "referer": "string",
- "member_id": 20000,
- "member_email": "recipient@example.com"
}
]
}
mail_id required | integer Mail ID. |
[- 20
]
{- "succeed": true,
- "result": {
- "open": {
- "open": 5,
- "openers": 3,
- "no-open": 2
}, - "clickers": 5,
- "click-hours": [
- {
- "hour": "21",
- "clickers": 5
}
], - "open-hours": [
- {
- "hour": "21",
- "openers": 5
}
]
}
}
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "mail_id": 20,
- "owner": 1,
- "members": 310,
- "created": "2020-01-04 14:00:32",
- "scheduled": "2020-01-07 10:00:00",
- "subject": "Example subject",
- "list_id": 60,
- "list_name": "Sample list"
}
]
}
[- "2019-12-20 14:00:00"
]
{- "succeed": true,
- "result": [
- {
- "joined": "2019-11-10 14:22:04",
- "list_id": 60,
- "member": 20000
}
]
}
[- 10
]
[- {
- "delivery_id": 10,
- "sent": 3,
- "sent_by_member": 2,
- "sent_by_member_recipient": 1,
- "subscriptions": 1,
- "clicks": 3,
- "clickers": 2
}, - [
- {
- "delivery_id": 10,
- "member": 20000,
- "sender_email": "sender@example.com",
- "clicked_at": "2020-01-13 08:50:29.723545",
- "clicked_time": 3,
- "useragent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
- "acceptlanguage": "en-US,en;q=0.9,fi;q=0.8",
- "browser": "chrome",
- "os": "nt",
- "os_version": "10",
- "remote_addr": "127.0.0.1",
- "hostname": "string",
- "continent_code": "string",
- "org_name": "string",
- "country_code": "string",
- "country_code3": "string",
- "country_name": "string",
- "region": "string",
- "city": "string",
- "postal_code": "string",
- "latitude": "string",
- "longitude": "string",
- "dma_code": "string",
- "area_code": "string",
- "referer": "string"
}
], - [
- {
- "id": 5004,
- "delivery_id": 10,
- "member": 1002,
- "sent_at": "2020-01-13 08:55:40.111231",
- "sender_email": "telling-a-friend@example.com",
- "sender_name": "Example Name",
- "sender_remote_addr": "127.0.0.1",
- "subject": "Example subject.",
- "body": "Thought this might be of interest to you.",
- "useragent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
- "acceptlanguage": "en-US,en;q=0.9,fi;q=0.8",
- "browser": "chrome",
- "browser_version": "80.0.3987.122",
- "os": "nt",
- "os_version": "10",
- "remote_addr": "127.0.0.1",
- "hostname": "string",
- "continent_code": "string",
- "org_name": "string",
- "country_code": "string",
- "country_code3": "string",
- "country_name": "string",
- "region": "string",
- "city": "string",
- "postal_code": "string",
- "latitude": "string",
- "longitude": "string",
- "dma_code": "string",
- "area_code": "string",
- "referer": "string"
}
]
]
delivery_id required | integer Delivery ID. |
list_id | integer Mailinglist ID. |
object |
[- 10,
- 60,
- {
- "postpone": null,
- "scheduled": "2020-02-15 14:00:00"
}
]
{- "succeed": true,
- "result": 2010
}
delivery_id required | integer Delivery ID. |
archive required | Array of arrays List of RSS feed names on which the delivery should be made visible. |
[- 10,
- [
- "feed-name",
- "another-feed"
]
]
{- "succeed": true,
- "result": [
- "feed-name",
- "another-feed"
]
}
List of RSS feed names on which the delivery is still visible.
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. |
[- 10,
- [
- "feed-name",
- "another-feed"
], - "string"
]
{- "succeed": true,
- "result": [
- "feed-name",
- "another-feed"
]
}
list_id required | integer Mailinglist ID. |
external_id | string Mailinglist external ID. |
external_id_type | string Mailinglist external ID type. |
[- 60,
- "abc123",
- "string"
]
{- "succeed": true,
- "result": null
}
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 Condition name can be any recipient property. Condition can be one of following: not equal: |
site | string Domain name of subscription site to add list for. Needs self-service to be |
cem_segment | integer If list is connected to an Automation segment, the segment ID comes here. Note: this needs to be |
ext_id | string Mailinglist external ID. |
ext_id_type | string Mailinglist external ID type. |
[- "Sample list",
- "Description text",
- false,
- "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }",
- "site-domain",
- null,
- "abc123",
- "string"
]
{- "succeed": true,
- "result": 60
}
list_id required | integer Mailinglist ID. |
type required | string Mailinglist external ID type. |
[- 60,
- "string"
]
{- "succeed": true,
- "result": null
}
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 Condition name can be any recipient property. Condition can be one of following: not equal: |
new_site | string Domain name of subscription site to add list for. Needs self-service to be |
new_cem_segment | integer If list is connected to an Automation segment, the segment ID comes here. Note: this needs to be |
[- 60,
- "Sample list",
- "Description text",
- false,
- "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }",
- "site-domain",
- 13
]
{- "succeed": true,
- "result": 60
}
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 Condition name can be any recipient property. Condition can be one of following: not equal: |
[- 60,
- "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"firstname.\"}], \"enabled\":true }"
]
{- "succeed": true,
- "result": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }"
}
list_id required | integer Mailinglist ID. |
self_service | boolean Controls whether the list is available for subscription from a subscription site. |
[- 60,
- false
]
{- "succeed": true,
- "result": [
- {
- "id": 12,
- "self_service": true
}, - {
- "id": 23,
- "self_service": false
}
]
}
list_external_id required | string Mailinglist external ID. |
list_external_id_type required | string Mailinglist external ID type. |
[- "abc123",
- "string"
]
{- "succeed": true,
- "result": 60
}
list_id required | integer Mailinglist ID. |
base64encoded | boolean If set to |
[- 60,
- false
]
{- "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"
}
list_id required | integer Mailinglist ID. |
get_sms_count | boolean Include count of members with SMS numbers. |
[- 60,
- true
]
{- "succeed": true,
- "result": {
- "id": 60,
- "name": "Sample list",
- "description": "Description text",
- "owner": 1,
- "condition": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }",
- "self_service": false,
- "members": 12,
- "domain": "list.domain",
- "deleted": "2020-01-15 12:45:21.0173942",
- "updated": "2020-01-15 12:45:21.0173942",
- "cem_segment": null
}
}
list_id required | integer Mailinglist ID. |
[- 60
]
{- "succeed": true,
- "result": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }"
}
list_id required | integer Mailinglist ID. |
list_external_id_type required | string Mailinglist external ID type. |
[- 60,
- "string"
]
{- "succeed": true,
- "result": "abc123"
}
list_id required | integer Mailinglist ID. |
from | integer Result offset |
num | integer Number of entries to return. |
order | string Property by which the list is ordered by. |
sort | string Sort direction. |
filter | string Filter by string. Can be email, sms (with country code) or value of other property which has to fully match. Special filters:
|
[- 60,
- 100,
- 0,
- "email",
- "desc",
- "property-value"
]
{- "succeed": true,
- "result": [
- 402,
- 512,
- 493
]
}
list_id required | integer Mailinglist ID. |
from | integer Start date for query in epoch format. Ignored when used with |
to | integer End date for query in epoch format. Ignored when used with |
condition | string Enum: "bounced" "unsubscribed" "left" "joined" "new"
|
cols | Array of arrays If empty then get all properties or specify properties to get. |
[- 60,
- 1573120800,
- 1573207200,
- "bounced",
- [
- "property"
]
]
{- "succeed": true,
- "result": "\"email\";\"sms\";\"property\""
}
Import statistics are returned if list import is in progress or queue.
include_deleted | integer If |
[- 1
]
{- "succeed": true,
- "result": [
- {
- "id": 60,
- "owner": 1,
- "name": "Sample list",
- "condition": "{\"conditions\":[{\"name\":\"email\", \"condition\":\"begins\", \"value\":\"testuser+\"}], \"enabled\":true }",
- "description": "Description text",
- "self_service": false,
- "deleted": "2020-01-15 12:45:21.0173942",
- "hidden": "2020-01-15 12:45:21.0173942",
- "site": "list.domain",
- "update": "2020-01-15 12:45:21.0173942",
- "created": "2020-01-15 12:45:21.0173942",
- "cem_segment": null,
- "health": 100,
- "health_updated": "2020-01-15 10:25:24.629731",
- "list": 60,
- "members": 4012,
- "import_status": "complete",
- "import_total": 100,
- "import_current": 92,
- "import_created": "2020-01-15 12:45:21.0173942"
}
]
}
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.
list_id required | integer Mailinglist ID. |
properties_client required | string Deprecated, set to |
csv required | string CSV data in raw or Base64 encoded format. Use:
|
receipt | string Deprecated, set to |
base64_encoded | boolean Data is Base64 encoded. Defaults to |
truncate | boolean Truncate list before import. Defaults to |
disable_cem_events | boolean Do not create any events for LianaAutomation from import. Defaults to |
use_list_props | boolean Wether to import the properties as default values or list specific values. Defaults to |
use_duplicates | boolean Use duplicate entries and put both into the list. Defaults to |
fork | string Deprecated, set to |
user_id | integer User associated with import. Optional identifier. Defaults to |
import_id | integer Import specific ID. To be given if specific import ID is to be used. Defaults to |
consent_id | integer Consent ID. |
consent_lang | string Consent language. |
[- 60,
- null,
- "string",
- null,
- false,
- false,
- false,
- false,
- false,
- null,
- null,
- 123,
- 4,
- "EN"
]
{- "succeed": true,
- "result": null
}
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.
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. |
[- 60,
- "[{\"email\":\"recipient1@example.com\",\"sms\":\"+35812345678\",\"property1\":\"value1\",\"property2\":\"value2\"},{\"email\":\"recipient2@example.com\",\"sms\":\"+35823456789\",\"property1\":\"value1\",\"property2\":\"value2\"}]"
]
{- "succeed": true,
- "result": true
}
list_id required | integer Mailinglist ID. |
properties_client | string Deprecated, set to |
csv required | string CSV data in raw or Base64 encoded format. Use:
|
receipt | string Deprecated, set to |
base64_encoded | boolean Data is Base64 encoded. Defaults to |
truncate | boolean Truncate list before import. Defaults to |
[- 60,
- null,
- "string",
- null,
- false,
- false
]
{- "succeed": true,
- "result": "email\nrecipient@bad.domain\n"
}
Gets a dynamic mailing lists target group and adds target group members to the mailinglist.
list_id required | integer Mailinglist ID. |
[- 60
]
{- "succeed": true,
- "result": "H:ws2-beta:231124"
}
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.
list_id required | integer Mailinglist ID. |
[- 60
]
{- "succeed": true,
- "result": null
}
Accepts ID or an array of IDs as input value. Returns key-value array with list ID as key and updated health as value.
list_id required | integer Mailinglist ID. |
[- 60
]
{- "succeed": true,
- "result": {
- "60": 100
}
}
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 |
source_data | string Free text field describing source. |
[- 20000,
- 4,
- 2,
- "EN",
- "api",
- "example.com/subscribe"
]
{- "succeed": true,
- "result": 4
}
recipients required | Array of arrays Array of recipient emails. |
[- [
- "recipient1@example.com",
- "recipient2@example.com"
]
]
{- "succeed": true,
- "result": true
}
code required | string Recipient confirmation code. |
reason | string Textual reason for recipient confirmation. |
origin | string Origin of confirmation, for example subscription page URL. |
[- "bdeCyBcrkf",
- "Example reason.",
- "example.com/subscription"
]
{- "succeed": true,
- "result": 20000
}
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.
id | integer Recipient ID. |
string Recipient email. | |
sms | string Recipient SMS. |
object Recipient properties. | |
autoconfirm | boolean If |
reason | string Reason for creation. |
origin | string Origin of action, eg. subscription page url or |
lists | Array of integers Array of mailinglists to join. |
admin | boolean Was the action initiated by admin. If set to |
[- 20000,
- "recipient@example.com",
- "+358401234567",
- {
- "property_name": "property_value"
}, - true,
- "Example reason.",
- "api",
- [
- 60
], - false
]
{- "succeed": true,
- "result": 20000
}
Property name restrictions apply here.
name | string Property name. |
language | string Property language. |
type | string Enum: "text" "numeric" "select" "checkbox" Property type. Defaults to |
choices | Array of arrays Possible choices to |
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 |
[- "Example name",
- "FI",
- "select",
- [
- "option-1",
- "option-2"
], - true,
- true,
- 1,
- "text"
]
{- "succeed": true,
- "result": 123
}
string Recipient email. | |
sms | string Recipient SMS. |
object Recipient properties. | |
autoconfirm | boolean If |
reason | string Reason for creation. |
origin | string Origin of action, eg. subscription page url or |
reactivate_bounced | boolean If Note! Email should only be activated if it is confirmed functional address. Abuse of the flag will lead to suspension of REST privileges. |
[- "recipient@example.com",
- "+358401234567",
- {
- "property_name": "property_value"
}, - true,
- "Example reason.",
- "api",
- false
]
{- "succeed": true,
- "result": 20000
}
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 |
[- 20000,
- "Reason",
- "Other",
- "Custom reason here",
- "api"
]
{- "succeed": true,
- "result": 1
}
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.
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 |
[- 20000,
- "recipient@example.com",
- "+358401234567",
- {
- "property_name": "property_value"
}, - "Example reason.",
- "api"
]
{- "succeed": true,
- "result": null
}
Returns list of recipients which have specified value on specified property.
property_id required | integer Property handle. See getCustomerProperties. |
property_value required | integer Property value. |
limit | integer Max number of matching recipients returned. Defaults to |
offset | integer Offset for limit (e.g. for pagination). Defaults to |
[- 123,
- "property_value",
- 2,
- 0
]
{- "succeed": true,
- "result": [
- {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
]
}
]
}
GDPR forget-me compliant subscriber erasure.
id required | integer Recipient ID. |
reason | string Textual reason for action. |
[- 20000,
- "Example reason."
]
{- "succeed": true,
- "result": 1
}
GDPR forget-me compliant subscriber erasure.
email required | string Recipient email. |
reason | string Textual reason for action. |
[- "recipient-to-forget@example.com",
- "Example reason."
]
{- "succeed": true,
- "result": 1
}
GDPR forget-me compliant subscriber erasure.
sms required | string Recipient SMS. |
reason | string Textual reason for action. |
[- "+35812345678",
- "Example reason."
]
{- "succeed": true,
- "result": 1
}
Get clickers filtered starting from parameter.
from required | string Start from date |
offset | integer Result offset |
[- "2019-12-20 14:00:00",
- 100
]
{- "succeed": true,
- "result": {
- "next_offset": 200,
- "offset": 100,
- "clickers": [
- {
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "properties": {
- "property_name": "property_value"
}, - "clicked_at": "2020-01-13 08:50:29.723545",
- "subject": "Example subject."
}
]
}
}
id required | integer Recipient ID. |
[- 20000
]
{- "succeed": true,
- "result": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
], - "properties": {
- "property_name": "property_value"
}, - "reason": {
- "deleted": "2020-01-15 10:25:24.629731",
- "reason": "Example reason."
}, - "deleted": "2020-01-15 10:25:24.629731"
}
}
from | integer Result offset |
num | integer How many |
order | string Property by which the list is ordered by. |
sort | string Sort direction. |
filter | string Filter by string. |
[- 100,
- 100,
- "email",
- "desc",
- "text"
]
{- "succeed": true,
- "result": [
- {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
], - "properties": {
- "property_name": "property_value"
}, - "reason": {
- "deleted": "2020-01-15 10:25:24.629731",
- "reason": "Example reason."
}, - "deleted": "2020-01-15 10:25:24.629731"
}
]
}
Fetch changes in GDPR compliant grounds for sending since given start date. Returns maximum of 1000 items per call.
from_date required | string Start from date |
offset | integer Result offset |
limit | integer Result limit |
object | |
consent_id | integer Consent ID. |
[- "2020-01-10T01:00:00+0200",
- 0,
- 1000,
- {
- "include_member_data": false
}, - 4
]
{- "succeed": true,
- "result": {
- "updates": [
- {
- "member_id": 20000,
- "consent_id": 4,
- "consent_language": "EN",
- "consent_revision": 2,
- "source": "site",
- "action": "revoked",
- "updated": "2020-01-25 15:23:11.222412",
- "member_data": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
]
}
}
], - "meta": {
- "response_at": "2020-01-26T10:00:00+0200",
- "pagination": {
- "from": 0,
- "to": 1000,
- "has_more": true
}, - "update_since": "2020-01-10T01:00:00+0200"
}
}
}
[- 20000
]
{- "succeed": true,
- "result": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
]
}
}
email required | string Recipient email. |
include_deleted | boolean Include deleted in results. Defaults to |
[- "recipient@example.com",
- true
]
{- "succeed": true,
- "result": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
], - "reason": {
- "deleted": "2020-01-15 10:25:24.629731",
- "reason": "Example reason."
}
}
}
sms required | string Recipient SMS. |
include_deleted | boolean Include deleted in results. Defaults to |
[- "+358401234567",
- true
]
{- "succeed": true,
- "result": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
], - "reason": {
- "deleted": "2020-01-15 10:25:24.629731",
- "reason": "Example reason."
}
}
}
Get recipient GDPR data in file.
id required | integer Recipient ID. |
required | object |
[- 20000,
]
{- "succeed": true,
- "result": "string"
}
id required | integer Recipient ID. |
limit | integer Maximum number of mails to get, zero for all. |
[- 20000,
- 0
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "subject": "Example subject",
- "scheduled": "2020-01-18 10:00:00",
- "delivered": true,
- "format": 1
}
]
}
ids | Array of arrays Array of recipient IDs. |
[- [
- 20001,
- 20100
]
]
{- "succeed": true,
- "result": [
- [
- "member",
- "email",
- "sms",
- "property"
], - [
- "20001",
- "example1@mail.com",
- "+358123456789",
- "prop-value"
], - [
- "20100",
- "example2@mail.com",
- "+358234567890",
- "other-prop-value"
]
]
}
from | integer Result offset |
num | integer How many |
order | string Property by which the list is ordered by. |
sort | string Sort direction. |
filter | string Filter by string. |
[- 100,
- 100,
- "email",
- "desc",
- "text"
]
{- "succeed": true,
- "result": [
- {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "confirmed": "2019-12-13 14:55:12.021953",
- "forgotten": false,
- "enabled": true
}, - "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
], - "properties": {
- "property_name": "property_value"
}, - "consents": [
- {
- "id": 123,
- "consent_id": 4,
- "consent_revision": 2,
- "consent_language": "EN",
- "source": "site",
- "double_optin": false,
- "granted": "2020-01-15 12:45:21.0173942",
- "revoked": "2020-01-25 15:23:11.222412",
- "created": "2020-01-15 12:45:21.0173942",
- "description": "Example description",
- "title": "Example title"
}
]
}
]
}
Get recipients mailing list related properties.
list_id required | integer Mailinglist ID. |
recipient_id | integer Recipient ID. |
[- 60,
- 20000
]
{- "succeed": true,
- "result": {
- "2000": {
- "property_name": "property value"
}
}
}
Maximum of 1000 recipients at once.
recipient_ids | Array of arrays Array of recipient IDs. |
values | Array of strings Items Enum: "opens" "clicks" Type of stats to get. |
[- [
- 1000,
- 1001,
- 1002
], - [
- "opens",
- "clicks"
]
]
{- "succeed": true,
- "result": {
- "2000": {
- "deliveries": 2,
- "opens": 2,
- "opens_pct": "100.00",
- "clicks": 2,
- "clicks_pct": "100.00"
}
}
}
recipient_ids | Array of arrays Array of recipient emails. |
[- [
- "recipient1@example.com",
- "recipient2@example.com"
]
]
{- "succeed": true,
- "result": {
- "recipient1@example.com": 0,
- "recipient2@example.com": 1
}
}
recipient_id | integer Recipient ID. |
[- 20000
]
{- "succeed": true,
- "result": {
- "recipient": {
- "id": 20000,
- "email": "recipient@example.com",
- "sms": "+358401234567",
- "enabled": true,
- "confirmed": "2019-12-13 14:55:12.021953",
- "membership": [
- [
- 60,
- "Sample list",
- "2019-12-13 14:55:12.021953",
- null
]
]
}, - "properties": [
- {
- "property_name": "property_value"
}
]
}
}
Get unique message recipients based on list IDs and adhoc email addresses
lists | Array of arrays Array of list IDs. |
adhocs | Array of arrays Array of adhoc email addresses. |
[- [
- 100,
- 101,
- 102
], - [
- "recipient@example.com"
]
]
{- "succeed": true,
- "result": 421
}
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.
from_date | string Start from date |
[- "2019-12-20"
]
{- "succeed": true,
- "result": [
- {
- "list": 60,
- "member_id": 20000,
- "member_email": "recipient@example.com",
- "reason": "Example reason.",
- "unsubscribed": "2019-11-10 14:22:04"
}
]
}
required | integer or string Email, SMS or ID of recipient. |
strict | boolean Inverted return values. |
[- 20000,
- false
]
{- "succeed": true,
- "result": 1
}
list_id required | integer Mailinglist ID. |
recipient_list required | Array of arrays List of recipient IDs. |
noauto | boolean Set to |
reason | string Textual reason for action. |
admin | boolean Was the action initiated by admin |
truncate | boolean Truncate list before import. Defaults to |
origin | string Origin of action, eg. subscription page url or |
rejoin | boolean Rejoin to list (enables repeatable welcome messages). Defaults to |
ignore_errors | boolean Ignore errors about missing recipients. Defaults to |
[- 60,
- [
- 1000,
- 1001,
- 1002
], - true,
- "Example reason.",
- false,
- false,
- "api",
- true,
- true
]
{- "succeed": true,
- "result": null
}
Get history of member actions. Call memberHistoryUpdate
before this for new data.
recipient_id required | integer Recipient ID. |
object |
[- 20000,
- {
- "from": "2019-12-20 14:00:00",
- "type": "sent-mail",
- "limit": 100,
- "offset": 100
}
]
{- "succeed": true,
- "result": [
- {
- "member_id": 20000,
- "type": "sent-mail",
- "date": "2020-01-18 16:22:10.622693",
- "reason": "Example reason.",
- "extra": "string",
- "reference_id": 0,
- "latitude": "string",
- "longitude": "string",
- "city": "string",
- "reference_name": "string",
- "remote_addr": "127.0.0.1"
}
]
}
Trigger member history updating. memberHistoryUpdateStatus can be called for state of this transaction.
recipient_id required | integer Recipient ID. |
[- 20000
]
{- "succeed": true,
- "result": 1
}
Returns array of recipient IDs. Last item of result array is count of recipients.
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. |
filter | string Filter by string. |
csv | boolean If result is wanted as CSV data. Defaults to |
gzip | boolean If CSV data is gzipped. Data will be returned as Base64. Defaults to |
[- "getRecipients",
- 60,
- 100,
- 100,
- "email",
- "desc",
- "text",
- true,
- true
]
{- "succeed": true,
- "result": [
- 502,
- 7001,
- 123,
- 3
]
}
This method works only for static members, and should be considered deprecated. Use removeRecipientFromMailingList instead: It works for both dynamic and static recipients.
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 |
origin | string Origin of action, eg. subscription page url or |
[- 60,
- 20000,
- "Example reason.",
- false,
- "api"
]
{- "succeed": true,
- "result": null
}
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 |
rise | string Deprecated, set to |
origin | string Origin of action, eg. subscription page url or |
object Recipient properties. |
[- "recipient@example.com",
- "Admin user.",
- "Example reason.",
- true,
- null,
- "api",
- {
- "property_name": "property_value"
}
]
{- "succeed": true,
- "result": 20000
}
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.
recipient_id required | integer Recipient ID. |
list_id required | integer Mailinglist ID. |
reason | string Textual reason for action. |
[- 20000,
- 60,
- "Example reason."
]
{- "succeed": true,
- "result": true
}
old_name required | string Existing property name. |
new_name required | string New property name. |
language required | string Property language. |
[- "Old name",
- "New name",
- "EN"
]
{- "succeed": true,
- "result": null
}
memberHistoryUpdateStatus can be called for state of this transaction.
object |
[- {
- "fromDate": "2020-01-20",
- "toDate": "2020-03-10"
}
]
{- "succeed": true,
- "result": "H:mailer:50$20a471d4e47d950609d3d38c92b487c3"
}
recipient_id required | integer Recipient ID. |
consent_id required | integer Consent ID. |
consent_revision required | integer Consent revision. |
consent_lang required | string Consent language. |
[- 20000,
- 4,
- 2,
- "EN"
]
{- "succeed": true,
- "result": null
}
recipient_id required | integer Recipient ID. |
required | object |
[- 20000,
- {
- "date": "2020-01-18 10:00:00",
- "subject": "Example subject.",
- "template": "<h1>title</h1> Sample text",
- "sender_email": "sender@example.com",
- "sender_name": "Message Sender",
- "reply_to": "replty@example.com"
}
]
{- "succeed": true,
- "result": 1
}
recipient_id required | integer Recipient ID. |
site required | string Domain name of subscription site to add list for. Needs self-service to be |
force | integer Set to |
props | object Key-value pair array of properties for the message. |
[- 20000,
- "site-domain",
- false,
- {
- "property_name": "property value"
}
]
{- "succeed": true,
- "result": 1
}
Generate and set confirmation code for recipient.
recipient_id required | integer Recipient ID. |
[- 20000
]
{- "succeed": true,
- "result": "bdeCyBcrkf"
}
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.
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 |
create | boolean Wether to create recipient if it does not exist. Defaults to |
[- "recipient@example.com",
- "+358401234567",
- {
- "firstname": "John",
- "lastname": "Doe"
}, - "Example reason.",
- "api",
- true
]
{- "succeed": true,
- "result": 20000
}
archive required | string Archive name. |
number required | integer How many |
order required | integer Change output order. |
[- "Archive",
- 100,
- 0
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "template": "<h1>title</h1> Sample text",
- "plaintext": "This is message content.",
- "subject": "Example subject.",
- "scheduled": "2020-01-18 10:00:00",
- "created": "2020-01-15 12:45:21.0173942",
- "members": 21,
- "delivered": 21,
- "list_id": 60,
- "campaign": 5,
- "feed_title": "Sample-feed"
}
]
}
[- [
- 10
]
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "mail_id": 20,
- "owner": 1,
- "members": 21,
- "delivered": 21,
- "bounced": 1,
- "created": "2020-01-15 14:55:00",
- "scheduled": "2020-01-18 10:00:00",
- "subject": "RXhhbXBsZSBzdWJqZWN0",
- "clicks": 2,
- "clickers": 36,
- "opens": 974,
- "openers": 974,
- "noopeners": 25,
- "list_id": 60,
- "list_name": "Example list",
- "list_deleted": null,
- "list_hidden": "2020-01-30 14:22:00",
- "archive": [
- "archive-name"
], - "rss": [
- "archive-name"
], - "html": "string",
- "plain": "string",
- "campaign": 5,
- "smscount": 412,
- "excluded": 33,
- "unsubscribed": 2,
- "direct_unsubscriptions": 1,
- "direct_subscriptions": 3,
- "done": 1,
- "smsreceived": 0,
- "type": "bulk",
- "user_id": 4000,
- "user_display_name": "Test Person",
- "tags": [
- "Tag1",
- "Tag2"
]
}
]
}
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. |
[- "2019-12-20",
- 100,
- "created ASC"
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "mail_id": 20,
- "owner": 1,
- "members": 21,
- "delivered": 21,
- "bounced": 1,
- "created": "2020-01-15 14:55:00",
- "scheduled": "2020-01-18 10:00:00",
- "subject": "RXhhbXBsZSBzdWJqZWN0",
- "clicks": 2,
- "clickers": 36,
- "opens": 974,
- "openers": 974,
- "noopeners": 25,
- "list_id": 60,
- "list_name": "Example list",
- "list_deleted": null,
- "list_hidden": "2020-01-30 14:22:00",
- "archive": [
- "archive-name"
], - "rss": [
- "archive-name"
], - "html": "string",
- "plain": "string",
- "campaign": 5,
- "smscount": 412,
- "excluded": 33,
- "unsubscribed": 2,
- "direct_unsubscriptions": 1,
- "direct_subscriptions": 3,
- "done": 1,
- "smsreceived": 0,
- "type": "bulk",
- "user_id": 4000,
- "user_display_name": "Test Person",
- "tags": [
- "Tag1",
- "Tag2"
]
}
]
}
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. |
[- "2019-12-20",
- 100,
- "created ASC"
]
{- "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\";"
}
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 |
[- 10,
- "clickers",
- {
- "sms": "phone_number"
}, - 12
]
{- "succeed": true,
- "result": "\"email\";\"sms\";\"format\";\"extra\";\"prop\""
}
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 |
[- 10,
- "clickers",
- {
- "sms": "phone_number"
}, - 12
]
{- "succeed": true,
- "result": [
- [
- "member",
- "format",
- "extra"
], - [
- 20001,
- 1,
- null
], - [
- 20002,
- 1,
- "member forget"
]
]
}
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 |
[- 10,
- "clickers",
- "104,106"
]
{- "succeed": true,
- "result": "\"email\";\"sms\";\"date\";\"format\";\"extra1\";\"extra2\""
}
delivery_id required | integer Delivery ID. |
[- 10
]
{- "succeed": true,
- "result": {
- "members": 21,
- "delivered": 21,
- "bounced": 1,
- "customer": 1,
- "mail": 20,
- "done": 1,
- "scheduled": "2020-01-18 10:00:00",
- "created": "2020-01-15 14:55:00",
- "campaign": 5,
- "list": 60,
- "list_name": "Sample list",
- "list_deleted": "2020-01-15 10:25:24.629731",
- "list_hidden": "2020-01-15 10:25:24.629731",
- "unsubscribed": 2,
- "rss": [
- "archive-name"
], - "archive": [
- "archive-name"
], - "smscount": 412,
- "direct_subscriptions": 3,
- "direct_unsubscriptions": 1,
- "smsreceived": 0
}
}
delivery_id required | integer Delivery ID. |
inline_only | integer Whether to count only embedded resources, like inline images and inline attachments. Defaults to |
[- 10,
- 1
]
{- "succeed": true,
- "result": 35490
}
deliveries required | Array of arrays Delivery IDs. |
[- [
- 11,
- 19
]
]
{- "succeed": true,
- "result": [
- {
- "id": 10,
- "members": 21,
- "delivered": 21,
- "done": 1
}
]
}
id required | integer Mail ID. |
encode | boolean If set to |
[- 20,
- false
]
{- "succeed": true,
- "result": {
- "id": 20,
- "template": "<h1>Title</h1> This is message content.",
- "plaintext": "This is message content.",
- "subject": "Example subject",
- "shortmessage": "Custom SMS content",
- "tracking": 1,
- "archive": 1,
- "images": [
- {
- "id": 4012,
- "filename": "f56ed425e86524927b8dcad24ec057b6.jpg",
- "mimetype": "image/jpg",
- "content_md5": "f56ed425e86524927b8dcad24ec057b6"
}
], - "attachments": [
- {
- "id": 4012,
- "filename": "f56ed425e86524927b8dcad24ec057b6.jpg",
- "content_md5": "f56ed425e86524927b8dcad24ec057b6"
}
]
}
}
archive required | string Archive name. |
num required | integer How many |
order | integer Change output order. |
[- "Archive",
- 100,
- 0
]
{- "succeed": true,
- "result": [
- {
- "rss_ingress": "Sample ingress",
- "id": 10,
- "template": "<h1>title</h1> Sample text",
- "plaintext": "This is message content.",
- "subject": "Example subject.",
- "scheduled": "2020-01-18 10:00:00",
- "created": "2020-01-15 12:45:21.0173942",
- "members": 21,
- "delivered": 21,
- "list_id": 60,
- "campaign": 5,
- "feed_title": "Sample-feed"
}
]
}
id required | integer Link ID. |
summary | integer If set to |
[- 600,
- 0
]
{- "succeed": true,
- "result": [
- {
- "member": 20000,
- "email": "recipient@example.com",
- "date": "2020-01-13 08:50:29.723545",
- "number": 2,
- "friend": 2
}
]
}
id required | integer Delivery ID. |
opened | integer Fetch openers |
[- 10,
- 0
]
{- "succeed": true,
- "result": [
- {
- "member": 20000,
- "email": "recipient@example.com",
- "date": "2020-01-13 08:50:29.723545",
- "number": 2
}
]
}
[- "site-domain"
]
{- "succeed": true,
- "result": {
- "site": "site-domain",
- "full_domain": "site-domain.postfix.com",
- "properties": [
- {
- "owner": 1,
- "handle": 123,
- "name": "Example name",
- "pos": 4
}
], - "lists": [
- {
- "owner": 1,
- "id": 60,
- "pos": 4,
- "name": "Sample list"
}
], - "labels": [
- {
- "id": 200,
- "site": "site-domain",
- "element": "string",
- "element_handle": 0,
- "label": "string"
}
], - "html_elements": [
- {
- "id": 10,
- "site": "site-domain",
- "element": "string",
- "element_handle": "string",
- "label": 0
}
], - "layout": {
- "index": "string",
- "cancel-form": "string",
- "deleted": "string",
- "footer": "string",
- "header": "string",
- "list-begin": "string",
- "list-end": "string",
- "list-element": "string",
- "welcome": "string",
- "confirm": "string",
- "confirm-forget-me": "string",
- "download-email": "string",
- "subscription-already-confirmed": "string",
- "subscriber-forgotten": "string"
}, - "marketing": {
- "footer": "string",
- "header": "string",
- "tellafriend-form": "string",
- "tellafriend-message": "string",
- "tellafriend-template": "string",
- "tellafriend-sent": "string"
}, - "authorization": {
- "part": "string",
- "domain": "site-domain",
- "allowed": true
}, - "domain": "site-domain",
- "owner": 1,
- "language": "EN",
- "accept_check": null,
- "welcome": 1,
- "ssl": true,
- "parent": "parent.site",
- "is_default": true,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": true,
- "whitelist_email": "sender@example.com",
- "redirect": "target-site",
- "postfix": "postfix.com",
- "envelope_sender": false,
- "domain_aliases": [
- "alternative-name"
], - "recaptcha_secret": "string",
- "embed_only": true,
- "replaced_by": "replacing-site",
- "rename_to": "new-domain",
- "hidden": false,
- "created": "2020-01-15 12:45:21.0173942",
- "has_csrf": true,
- "deny_framing": true
}
}
domain required | string Site domain name. |
object |
[- "site-domain",
- {
- "site": "site-domain",
- "lang": "EN",
- "welcome": 1,
- "ssl": true,
- "is_default": true,
- "whitelist_instruction": true,
- "whitelist_email": "sender@example.com",
- "parent": "parent.site",
- "redirect": "target-site",
- "postfix": "postfix.com",
- "envelope_sender": true,
- "domain_aliases": [
- "alternative-name"
], - "recaptcha_secret": "string",
- "embed_only": true,
- "has_csrf": true,
- "deny_framing": true
}
]
{- "succeed": true,
- "result": "site-domain"
}
domain required | string Site domain name. |
object |
[- "site-domain",
- {
- "site": "site-domain",
- "lang": "EN",
- "welcome": 1,
- "ssl": true,
- "is_default": true,
- "whitelist_instruction": true,
- "whitelist_email": "sender@example.com",
- "parent": "parent.site",
- "redirect": "target-site",
- "postfix": "postfix.com",
- "envelope_sender": true,
- "domain_aliases": [
- "alternative-name"
], - "recaptcha_secret": "string",
- "embed_only": true,
- "has_csrf": true,
- "deny_framing": true
}
]
{- "succeed": true,
- "result": true
}
object Return layout and property data (refaults to | |
object |
[- {
- "properties": false,
- "lists": false,
- "layout": false,
- "marketing": false,
- "parents": false,
- "children": false,
- "authorization": false
}, - {
- "all_lists": false
}
]
{- "succeed": true,
- "result": [
- {
- "site": "site-domain",
- "full_domain": "site-domain.postfix.com",
- "properties": [
- {
- "owner": 1,
- "handle": 123,
- "name": "Example name",
- "pos": 4
}
], - "lists": [
- {
- "owner": 1,
- "id": 60,
- "pos": 4,
- "name": "Sample list"
}
], - "labels": [
- {
- "id": 200,
- "site": "site-domain",
- "element": "string",
- "element_handle": 0,
- "label": "string"
}
], - "html_elements": [
- {
- "id": 10,
- "site": "site-domain",
- "element": "string",
- "element_handle": "string",
- "label": 0
}
], - "layout": {
- "index": "string",
- "cancel-form": "string",
- "deleted": "string",
- "footer": "string",
- "header": "string",
- "list-begin": "string",
- "list-end": "string",
- "list-element": "string",
- "welcome": "string",
- "confirm": "string",
- "confirm-forget-me": "string",
- "download-email": "string",
- "subscription-already-confirmed": "string",
- "subscriber-forgotten": "string"
}, - "marketing": {
- "footer": "string",
- "header": "string",
- "tellafriend-form": "string",
- "tellafriend-message": "string",
- "tellafriend-template": "string",
- "tellafriend-sent": "string"
}, - "authorization": {
- "part": "string",
- "domain": "site-domain",
- "allowed": true
}, - "domain": "site-domain",
- "owner": 1,
- "language": "EN",
- "accept_check": null,
- "welcome": 1,
- "ssl": true,
- "parent": "parent.site",
- "is_default": true,
- "email_pos": 0,
- "sms_pos": 1,
- "deleted": null,
- "whitelist_instruction": true,
- "whitelist_email": "sender@example.com",
- "redirect": "target-site",
- "postfix": "postfix.com",
- "envelope_sender": false,
- "domain_aliases": [
- "alternative-name"
], - "recaptcha_secret": "string",
- "embed_only": true,
- "replaced_by": "replacing-site",
- "rename_to": "new-domain",
- "hidden": false,
- "created": "2020-01-15 12:45:21.0173942",
- "has_csrf": true,
- "deny_framing": true
}
]
}
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. |
[- 20,
- 10
]
{- "succeed": true,
- "result": [
- {
- "date": "2024-09-12T02:18:08+03:00",
- "rating": 76,
- "abuse": 100,
- "hardbounces": 72,
- "lists": 96,
- "opens": 100,
- "clicks": 42,
- "ctor": 23
}
]
}
{- "succeed": true,
- "result": {
- "database_size": 4020,
- "active_members": 4020,
- "deleted_members": 4,
- "unsubscribed_members": 11,
- "join_past_30_days": 19,
- "left_past_30_days": 3,
- "joined_by_day": "2020-01-15:5",
- "left_by_day": "2020-01-15:2",
- "last_subscribers_unassociated_update": "2020-01-15:2",
- "unassociated_members": 11,
- "all_time_email": 612,
- "all_time_sms": 7,
- "emails_by_month": "2020-01-15:128",
- "sms_by_month": "2020-01-15:7",
- "all_time_sms_real": 7,
- "sms_by_month_real": "2020-01-15:7",
- "subscribers_received_message": 4000,
- "subscribers_received_message_percent": "99.50",
- "subscribers_received_message_trend": 1,
- "subscribers_active": 4000,
- "subscribers_active_percent": "99.50",
- "subscribers_active_trend": 1,
- "subscribers_emailed_by_month": "2020-01-15:128",
- "subscribers_emailed_by_year": "2020:512",
- "sms_received_by_month": "2020-01-15:12",
- "enabled": 4000,
- "disabled": 20,
- "subscribers_unassociated": 11,
- "subscribers_deleted": 0
}
}
Add task which is to be run upon clicking of confirmation link on welcome message, or by calling confirmRecipient
.
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. |
[- 20000,
- "bdeCyBcrkf",
- "membership",
- {
- "consent_id": 10,
- "lang": "EN",
- "consent_revision": 1,
- "source": "api",
- "site": "site.com",
- "list_id": 200,
- "properties": {
- "property_name": "Property value",
- "another_property": 100
}
}
]
{- "succeed": true,
- "result": 1
}
Add tasks which are to be run upon clicking of confirmation link on welcome message, or by calling confirmRecipient
.
member_id required | integer Recipient ID. |
confirmation_code required | string Recipient confirmation code. |
required | Array of objects |
[- 20000,
- "bdeCyBcrkf",
- [
- {
- "type": "membership",
- "consent_id": 10,
- "lang": "EN",
- "consent_revision": 1,
- "source": "api",
- "site": "site.com",
- "list_id": 200,
- "properties": {
- "property_name": "Property value",
- "another_property": 100
}
}
]
]
{- "succeed": true,
- "result": [
- {
- "result": null
}
]
}
name required | string Name of consent type. |
is_revokable required | boolean Consent revokable state. |
[- "type",
- true
]
{- "succeed": true,
- "result": 4
}
consent_id required | integer Consent ID. |
lang required | string Consent language. |
title required | string Consent title. |
description required | string Consent description. |
[- 4,
- "EN",
- "Example title",
- "Example description"
]
{- "succeed": true,
- "result": 2
}
consent_id required | integer Consent ID. |
name required | string Name of consent type. |
is_revokable required | integer Consent revision. |
[- 4,
- "type",
- 2
]
{- "succeed": true,
- "result": 1
}
confirmation_code required | string Recipient confirmation code. |
[- "bdeCyBcrkf"
]
{- "succeed": true,
- "result": [
- {
- "type": "membership",
- "payload": "{\"list_id\":\"102\",\"site\":\"site.domain\",\"member_id\":\"20000\"}"
}
]
}
{- "succeed": true,
- "result": [
- {
- "id": 4,
- "name": "type",
- "is_revokable": true,
- "created": "2020-01-15 12:45:21.0173942",
- "languages": [
- {
- "id": 4,
- "language": "EN",
- "revision": 2,
- "title": "Example title",
- "description": "Example description",
- "created": "2020-01-15 12:45:21.0173942"
}
]
}
]
}
site required | string Domain name of subscription site to add list for. Needs self-service to be |
[- "site-domain"
]
{- "succeed": true,
- "result": [
- {
- "consent_id": 4,
- "is_revokable": true,
- "name": "type",
- "consent_revision": 2,
- "pos": 1001,
- "title": "Example title",
- "description": "Example description",
- "language": "EN",
- "created": "2020-01-15 12:45:21.0173942"
}
]
}
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.
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. |
{- "letter": {
- "type": "draft",
- "id": 123,
- "revision": 1,
- "attachments": [
- {
- "data_base64": "c2FtcGxlIGRhdGE=",
- "name": "file1.csv",
- "type": "text/csv"
}, - {
- "data": "sample data",
- "name": "file2.csv",
- "type": "text/csv"
}
], - "subject": "Message subject",
- "preheader_text": "Message preheader",
- "html": "<h1>Title</h1> This is custom message text.",
- "plain": "This is custom text.",
- "sender": "Firstname Lastname <sender@example.com>",
- "sms": "Custom SMS content",
- "sms_sender": "Sender",
- "images_as_link": true,
- "recipients_reset": true,
- "bgcolor": "#ff0000"
}, - "recipients": [
- {
- "email": "recipient1@example.com"
}, - {
- "email": "recipient2@example.com"
}
], - "tracking_id": "customabc123"
}
{- "succeed": true,
- "result": {
- "id": "42",
- "revision": 2,
- "deliveries": [
- 21
], - "mails": [
- 21
], - "tracking": "5e5cd927d049b"
}
}
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.
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. |
{- "letter": {
- "type": "draft",
- "id": 123,
- "revision": 1,
- "subject": "Message subject",
- "ab": {
- "alternative_subjects": [
- "Alt subject",
- "Another alt subject"
], - "wait_period": 3600
}, - "preheader_text": "Message preheader",
- "schedule": {
- "delivery": "2020-10-01 06:52:00",
- "timezone": "Europe/London"
}, - "html": "<h1>Title</h1> This is custom message text.",
- "plain": "This is custom text.",
- "sender": "Firstname Lastname <sender@example.com>",
- "sms": "Custom SMS content",
- "sms_sender": "Sender",
- "tracking": [
- "open",
- "link"
], - "consents": [
- 2,
- 15
], - "delivery_tags": [
- "Offers",
- "News"
], - "images_as_link": true,
- "disable_unsubscribe": false,
- "bgcolor": "#ff0000"
}, - "recipients": [
- {
- "email": "recipient1@example.com"
}, - {
- "email": "recipient2@example.com"
}
], - "lists": [
- 1,
- 5
]
}
{- "succeed": true,
- "result": {
- "id": "42",
- "revision": 2,
- "deliveries": [
- 21
], - "mails": [
- 21
]
}
}
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.
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. |
{- "letter": {
- "sender": "Firstname Lastname <sender@example.com>",
- "subject": "Message subject",
- "ab": {
- "alternative_subjects": [
- "Alt subject",
- "Another alt subject"
], - "wait_period": 3600
}, - "preheader_text": "Message preheader",
- "tracking": [
- "open",
- "link"
], - "consents": [
- 2,
- 15
], - "delivery_tags": [
- "Offers",
- "News"
], - "images_as_link": true,
- "disable_unsubscribe": false
}, - "recipients": [
- {
- "email": "recipient1@example.com"
}, - {
- "email": "recipient2@example.com"
}
], - "lists": [
- 1,
- 5
]
}
{- "succeed": true,
- "result": {
- "id": "42",
- "revision": 2,
- "deliveries": [
- 21
], - "mails": [
- 21
]
}
}
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.
list_id required | integer Mailinglist ID if importing to existing list. Required if |
name required | string Mailinglist name. Required if
|
data required | string List contents Base64 encoded. |
type required | string Input format (csv/xls). If csv, use:
|
folder | string Mailinglist folder path. Created if does not exist. Supports multi level folders. If used together with
If used when
|
truncate | boolean Truncate mailinglist before importing. Defaults to |
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. |
{- "list_id": 101,
- "name": "The does",
- "data": "ImVtYWlsIjsiZmlyc3RuY...",
- "type": "csv",
- "folder": "Example",
- "truncate": true,
- "consent_id": 4,
- "consent_lang": "EN"
}
{- "succeed": true,
- "result": {
- "succeed": true,
- "list_id": 101
}
}
delivery_id required | integer Delivery ID. |
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: |
properties | Array of strings Example: properties[0]=firstname&properties[1]=lastname |
sort | string Example: sort=-event.at Sortable fields: |
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 |
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() . ""; }
{- "items": [
- {
- "id": 5,
- "email": "john.doe@example.com",
- "sms": "+12345678",
- "properties": {
- "firstname": "John",
- "lastname": "Doe"
}, - "event": {
- "at": "2017-01-01T01:01:01Z",
- "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36",
- "accept_language": "fi",
- "remote_address": "127.0.0.1",
},
}
], - "meta": {
- "response_at": "2017-01-01T01:01:01+0200"
}
}
delivery_id required | integer Delivery ID. |
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: |
properties | Array of strings Example: properties[0]=firstname&properties[1]=lastname |
sort | string Example: sort=-event.at Sortable fields: |
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 |
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() . ""; }
{- "items": [
- {
- "id": 5,
- "email": "john.doe@example.com",
- "sms": "+12345678",
- "properties": {
- "firstname": "John",
- "lastname": "Doe"
}, - "event": {
- "at": "2017-01-01T01:01:01Z",
- "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36",
- "accept_language": "fi",
- "remote_address": "127.0.0.1",
- "friend_click": true
},
}
], - "meta": {
- "response_at": "2017-01-01T01:01:01+0200"
}
}
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 |
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 |
sort | string Example: sort=-at Sortable field: |
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 |
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 |
list_data | boolean If set to |
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() . ""; }
{- "items": [
- {
- "at": "2017-01-01T01-01-01+02:00",
- "type": "mailbounce",
- "data": {
- "delivery-id": 1,
- "list-id": 7
}, - "recipient": {
- "id": 5,
- "email": "bouncing@email.com",
- "sms": "+12345678",
- "properties": {
- "firstname": "John",
- "lastname": "Doe"
}
}, - "reason": "domain_error",
}
], - "meta": {
- "response_at": "2017-01-01T01:01:01+0200"
}
}