Getting Started With Our API

Overview

Learn how to get your API Key, use our API calls to import contacts, send emails, and retrieve email reports. We have also provided you with code samples, including a code breakdown, for simpler integration and easier implementation.


Read the How APIs Work document for an in-depth look at APIs and how they integrate between systems.

Using the API

Let's look at specific tasks you might need to complete the first time you want to send an email with our API. The examples below have detailed pages which give the properties and code examples for each request. We've also provided a link to each page below.

For a full list of all API codes and how to use them, read through the API References page.

 

The API Key

An important facet of API authentication is the API key. The API key is a secret token which is passed with the API calls to identify the origin of the request. This key may seem like a string of random characters to you or me, but it is constructed in a specific way. The receiving system will recognise the construction, if it is valid, and process the request passed with the key.

Basic HTTP Authentication works by adding a header in your request. Request headers are a list of key-value pairs. The key for the header to add for authentication is "Authorization". The value for the header is the word "Basic" followed by a space followed by a base64 encoded hash. To generate this base64 encoded hash, start with the string "username:apikey", substituting your username and apikey with those given in the system. Next, you will run a base64 encode function on that string.

An API key used with Basic Authentication might look something like this:

Authorization: Basic QmF0bWFuOkJydWNlV2F5bmU=

You'll use your username and the key provided to authenticate and access your account. Request your API key from the support team.

Create a List

Subscription lists are used to send email campaigns to groups of contacts. A contact will have a subscription status to a list, denoting whether or not the contact should receive messages when a campaign is sent to a list.

The Method

API Method
RESTPOSThttp://[Your URL]/api/2.0/lists
XML-RPCCalllists.CreateList
Your URL is the address of your Everlytic install.

Your request must be structured as follows:

CreateList(\struct | array $properties) : int

Responses

The system will return either a success or failure message. If the request failed, the system will provide you with an error message, when successful you will receive your list ID. This is the ID you'll use when adding contacts to the list.

Code Sample

We use JSON to enclose the variables at the top of the API request.


Read the Create a list tutorial for a deeper look at creating lists.

Create Contact

Once your list is created, you can add contacts to the list.

The Method

API MethodDetails
RESTPOSThttp://[Your URL]/api/2.0/contacts
XML-RPCCallcontacts.CreateContactPass the correct data with this function.
Your URL is the address of your Everlytic install.

Your method must be structured as follows:

CreateContact(\struct | array $properties) : int

Code Sample


Remember to include the following parameters when creating a contact:

  • "create_notifications":"yes": This sends a notification to the list owner when a subscriber confirms their subscription.
  • "on_duplicate":"update": This ensures any existing contacts on the list are updated, preventing duplicates

For a full list of parameters, read the Create a new contact tutorial for a deeper look at creating lists.

Create Email

Email campaigns are used to send email messages to a list of contacts. Creating and sending the campaign are two different actions.

The Method

API Method
RESTPOSThttp://[Your URL]/api/2.0/emails
XML-RPCCallemails.CreateEmail
Your URL is the address of your Everlytic install.

Your request must be structured as follows:

CreateEmail(\struct | array $properties) : int

Responses

The system will return either a success or failure message. If the request failed, the system will provide you with an error message. Upon success you will receive the ID of your created email. This is the ID you'll use when sending the email.

Code Sample


Creating the campaign puts it in the 'composing' state, giving you the opportunity to add and remove lists, and tweak the campaign parameters.

Send Email

Once you're done creating your email, you can trigger the sending of the campaign by creating a Send Email Action for the specific email.

The Method

API Method
RESTPOSThttp://[Your URL]/api/2.0/email_actions/send/:id
XML-RPCCallemails.SendEmail
Your URL is the address of your Everlytic install.

Your request must be structured as follows:

SendEmail(integer $id)

Email Reports

You can use the Fetch Email Report request to retrieve reports on a specific email. Use the ID of the email you want the reports on, and specify which report you want the system to return.

The Method

API Method
RESTGEThttp://[Your URL]/api/2.0/emails/:id/report/:report
XML-RPCCallemail._reports.EmailReports
Your URL is the address of your Everlytic install.

Your request must be structured as follows:

EmailReports(integer $id, string $report) : array
Translate »