LianaMailer

Introduction

The LianaMailer REST API lets your applications manage contacts and mailing lists, send newsletters and transactional mail, and read delivery reports and tracking events. Responses are JSON.

API versions

The API has three versions. They cover different tasks rather than replacing each other, and they all use the same credentials.

VersionRequestsUse it for
v1POST with a JSON body, e.g. /v1/getRecipientAccount, sites, contacts, mailing lists, deliveries and reports
v2POST with a JSON bodyImporting mailing lists, and sending batch, event and web page mail
v3GET with query parametersPaged lists of delivery openers and clickers, and tracking events

See Parameters for how each version takes its parameters.

Regions

Send requests to {base URL}/api/{version}/{endpoint}, using the base URL of your region:

RegionAPI URL
EUhttps://rest.lianamailer.com
Asiahttps://rest.asia.lianamailer.com
Dubaihttps://rest.me.lianamailer.com

For example, getRecipient in the EU region is https://rest.lianamailer.com/api/v1/getRecipient.

Make your first request

The v1 echoMessage endpoint returns the message you send. Use it to check that your credentials and the connection work.

  1. Get a Bearer token

    Create a client ID and secret in LianaAccount, and request a token with them. The examples request the scope mailer-api, which is optional. The token is valid for 15 minutes.

  2. Send the request

    curl --request POST 'https://rest.lianamailer.com/api/v1/echoMessage' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{"msg":"hello"}'
  3. Check the response

    JSONResponse
    { "succeed": true, "result": "hello" }

    In v1 and v2, a successful response has succeed set to true and the data in result. When a request fails, succeed is false and message describes the error, and the HTTP status is usually still 200. See Errors for v3 and for handling errors.

Next steps

Start with the basics, in this order:

  1. Authorization: getting a Bearer token.
  2. Parameters: how v1, v2 and v3 take their parameters, and paging in v3.
  3. Restrictions: request rate limits and reserved property names.
  4. Errors: how each version reports errors, and how to handle them.

Then pick the guide for what you are building:

Then browse the endpoints, with examples in cURL, JavaScript, Python, PHP, Java, C#, Go and Ruby:

ContactsCreate, find, update, disable and delete the people you send email or SMS to, identified by a contact ID, an email address or an SMS number.PropertiesStore extra information about contacts, such as a name or a customer number.ConsentsDefine what contacts can agree to, such as receiving newsletters, and record the consents they give or revoke.ConfirmationWith double opt-in, a new contact confirms their email address by clicking a link in a confirmation email.Mailing listsGroup the contacts you send deliveries to.List membersAdd contacts to mailing lists and remove them, list and count the members of a list, and follow subscriptions and unsubscriptions.List importsAdd many contacts to a mailing list at once in CSV or JSON format, and follow the progress of the import.DeliveriesFollow the mails sent to groups of contacts, right away or at a scheduled time: find deliveries, check their status, and cancel, reschedule or hide them.MailsThe content of a message: its subject, body and links.ReportsWho received, opened and clicked sent deliveries, how the links performed, and tell-a-friend data.Archives and RSSPublish sent deliveries in public web archives and RSS feeds, and list the deliveries published there.SitesThe domain, language and layout of the public pages that contacts see, such as the subscription, confirmation and unsubscribe pages.AccountGet the account details, sent mail counts, statistics, deliverability ratings and received SMS messages, and manage the marketing settings and LianaAutomation tracking.SystemTest the connection and your credentials, and get details of the API server.SendingUse event send for single personal or transactional emails, batch send for deliveries to mailing lists, and web page send to send a web page as a newsletter.ImportAdd contacts to a mailing list in a single request.PingTest the connection and your credentials with the v2 API.EventsSent, opened and bounced mails, link clicks, list joins, data changes and other actions of the contacts in your account.Delivery reportsPaged lists of the contacts who opened a delivery or clicked its links.
Last modified on