Download OpenAPI specification:Download
LianaAutomation REST API documentation.
Your requests needs the following headers:
application/json
All requests must include HTTP Authorization header with correct signature. The header is valid for 15 minutes, based on given timestamp.
Format of the HTTP Authorization header:
REALM USERID:SIGNATURE
Signature is generated using HMAC with SHA-256 algorithm.
The key for HMAC is the REST user password and the message is constructed in the following way:
POST
.Content-md5
header.Content-Type
header, being application/json
.Date
header.POST
b41c090e9b32a3f85c631db1af38b0af
application/json
2099-01-01 00:00:00+0200
{"ping":"pong"}
/rest/v1/pingpong
HMAC_SHA256("password", message)
= d0e9d4895b0a06e19623b6c63cf6b173d9fa8ca3427ccb680c22209b90d7bb5e
Failure of providing the correct headers and authentication can result in the following errors. Note that the HTTP response code remains 200 OK.
"message": "RESTv1 unauthorized login attempt: Checksum does not match!"
The body checksum calculated on the server does not match the header Content-md5
"message": "RESTv1 unauthorized login attempt: User not valid!"
An invalid user was provided. Check if you provided the correct USERID
.
"message": "RESTv1 unauthorized login attempt: Hash mismatch!"
The signature
part of the authorization header does not match the calculated signature by the server. Possibly a wrong API key or other variable was used when calculating the signature
{"message":"Not found","status":404,"status_message":"Not Found"}
Either a wrong url or REALM
was used when making the API call.
This utility function can be used for verifying connections with the LianaAutomation REST API. This is the first command you should try out before investing time into the more complex ones
ping | string |
{- "ping": "pong"
}
{- "pong": "pong"
}
Bring data to LianaAutomation from external systems.
channel required | string The channel system name or ID. Channel ID is used to track the source of the data. Can be found from LianaAutomation under Settings from the Admin Channels -page |
no_duplicates | boolean If true, do not create a new duplicate event when an identical event already exists. Automations will not be triggered. |
skip_automations | boolean If true, this import will not trigger automations. |
required | Array of objects An array of multiple identities and events related to that identity. |
{- "channel": "string",
- "no_duplicates": true,
- "skip_automations": true,
- "data": [
- {
- "identity": {
- "email": "string",
- "sms": "string",
- "extra1": "string",
- "extra2": "string",
- "token": "string"
}, - "events": [
- {
- "verb": "string",
- "items": {
- "example-key1": "string",
- "example-key2": "string"
}
}
]
}
]
}
{- "succeed": true,
- "handle": "string"
}
Make a database search request
channels | Array of strings Channels to search from |
verbs | Array of strings Event types to search for |
from | string <date-time> Event is newer than |
to | string <date-time> Event is older than |
include_data | boolean Include event data in response |
limit | integer Default: 10000 Limit event count in result. Maximum is 10000 |
offset | integer Offset for traversing large event counts |
Array of objects Persons to search for |
{- "channels": [
- 1
], - "verbs": [
- "contact"
], - "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "include_data": true,
- "limit": 10000,
- "offset": 0,
- "identities": [
- {
- "email": "user@company.com",
- "sms": "+3560101234567",
- "extra1": "extra1",
- "extra2": "extra2",
- "token": "abc123",
- "id": "1234"
}
]
}
{- "handle": "1234"
}
Check if a requested database search is completed.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
{- "ready": true
}
Fetch search results of a finished request
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
[- {
- "at": "2019-08-24T14:15:22Z",
- "verb": "created",
- "channel": "2",
- "identity": {
- "id": "1234",
- "token": "abc123",
- "email": "user@company.com",
- "sms": "+3580101234567",
- "extra1": "extra1",
- "extra2": "extra2"
}, - "data": {
- "date": "2019-08-24T14:15:22Z",
- "origin": "admin.mailer.domain"
}
}
]
Request data to be deleted from database.
channels | Array of strings Channels to delete from |
Array of objects Persons to delete |
{- "channels": [
- 1
], - "identities": [
- {
- "id": [
- "1234"
], - "email": [
- "user@company.com"
], - "sms": [
- "+3580101234567"
], - "extra1": [
- "extra1"
], - "extra2": [
- "extra"
]
}
]
}
{- "handle": "1234"
}
Check if a delete request is finished.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
{- "ready": true
}
Returns LianaAutomation system id of the deleted items.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
{- "deleted": [
- [
- 1,
- 2,
- 3
]
]
}
Check if an export request is ready.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
{- "ready": true
}
Export results of a finished export request.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
[- {
- "email": "user@company.com",
- "sms": "+3580101234567",
- "system-event-date": "2019-08-24T14:15:22Z",
- "formsend-sentfrom": "NULL",
- "id": 1234
}
]
List of channels. Depending on channel type different fields will be returned.
[- {
- "id": 1,
- "name": "Automation",
- "color": "#37aef3",
- "front_url": "//t.lianacem.com",
- "icon": "",
- "tracking_enabled": true,
- "notes": "",
- "system_name": "",
- "tracking_js": "",
- "import_js": "",
- "verbs": {
- "contact": true,
- "formsend": false
}, - "type": "empty",
- "default_url": "",
- "events": 100
}
]
Create channel. Only channels without type can be created.
name required | string |
color | string |
tracking_enabled | boolean Default: false |
notes | string |
{- "name": "Automation",
- "color": "#37aef3",
- "tracking_enabled": true,
- "notes": ""
}
{- "id": 1,
- "name": "Automation",
- "color": "#37aef3",
- "front_url": "//t.lianacem.com",
- "icon": "",
- "tracking_enabled": true,
- "notes": "",
- "system_name": "",
- "tracking_js": "",
- "import_js": "",
- "verbs": {
- "contact": true,
- "formsend": false
}, - "type": "empty",
- "default_url": "",
- "events": 100
}
Edit channel. Only channels without type can be edited.
id required | integer |
name | string |
color | string |
tracking_enabled | boolean Default: false |
notes | string |
{- "id": 10,
- "name": "Automation",
- "color": "#37aef3",
- "tracking_enabled": true,
- "notes": ""
}
{- "id": 1,
- "name": "Automation",
- "color": "#37aef3",
- "front_url": "//t.lianacem.com",
- "icon": "",
- "tracking_enabled": true,
- "notes": "",
- "system_name": "",
- "tracking_js": "",
- "import_js": "",
- "verbs": {
- "contact": true,
- "formsend": false
}, - "type": "empty",
- "default_url": "",
- "events": 100
}
Delete channel. Channel can be deleted only if it doesn't have type, events and is not used in any automation or segment.
id required | integer |
{- "id": 10
}
{- "succeed": true
}
Make a automations report request
start_date required | string |
end_date required | string |
{- "start_date": "2022-02-01",
- "end_date": "2022-02-25"
}
{- "handle": "1234"
}
Check if a requested automations report is completed.
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
{- "ready": true
}
Fetch results of a finished request
handle | string The handle returned as response from the initial request |
{- "handle": "1234"
}
[- {
- "id": 91,
- "name": "Automation",
- "enabled": true,
- "summary": {
- "bounces": 0,
- "clickers": 0,
- "clicks": 0,
- "ctr": 0,
- "engagement": 5,
- "non-openers": 19,
- "openers": 81,
- "opens": 100,
- "or": 81,
- "persons": 100,
- "person-engagement": 0,
- "sent": 400
}, - "messages": [
- {
- "id": 58,
- "subject": "Message subject",
- "rates": {
- "current": {
- "mailopen": {
- "avg": 41.5,
- "total": 41.5,
- "trend": -88
}, - "maillink": {
- "avg": 0,
- "total": 0,
- "trend": 0
}
}, - "month": {
- "mailopen": {
- "avg": 0,
- "total": 0,
- "trend": 0
}, - "maillink": {
- "avg": 0,
- "total": 0,
- "trend": 0
}
}
}, - "graph": {
- "mailsent": {
- "counts": [
- 0,
- 1,
- 1
], - "total_count": 2,
- "highest_count": 2
}, - "mailopen": {
- "counts": [
- 1,
- 0,
- 2
], - "ratios": [
- 20.5,
- 0,
- 1.1
], - "total_count": 3,
- "highest_count": 2,
- "highest_ratio": 20.5
}, - "maillink": {
- "counts": [
- 1,
- 0,
- 1
], - "ratios": [
- 15.5,
- 0,
- 2.5
], - "total_count": 2,
- "highest_count": 1,
- "highest_ratio": 15.5
}, - "categories": [
- "2020-06-01T00:00:00+03:00",
- "2020-07-01T00:00:00+03:00",
- "2020-08-01T00:00:00+03:00"
], - "highest_count": 3,
- "highest_ratio": 20.5,
- "interval": "month"
}, - "summary": {
- "bounces": 0,
- "clickers": 0,
- "clicks": 0,
- "ctr": 0,
- "engagement": 5,
- "non-openers": 19,
- "openers": 81,
- "opens": 100,
- "or": 81,
- "person-engagement": 0,
- "persons": 100,
- "sent": 400
}
}
]
}
]