API for Developers

API (Application Programming Interface) — is a programming interface, a set of ready-made functions and code provided by an application.

Developers use it to integrate the service with third-party systems and apps.

General Information

Description

The Estismail REST API defines a set of functions for interaction over the HTTP protocol.

All responses are returned in JSON format by default, with optional XML output.

Authorization

Authorization is performed using a personal API key, sent with each request in the HTTP header X-Estis-Auth.

To obtain your key, go to “My Account” → “My Settings” → “API” tab and click “Generate”.

Base URL

All API requests use UTF-8 encoding and must be sent via HTTPS to:

https://v1.estismail.com/[section]/[resource]

HTTP Methods

Methods

Description

get

Retrieve a resource

post

Create a resource

put

Update a resource

delete

Delete a resource

Main API Methods

Method Name

Description

index

Retrieve the full list of resource items.

view

Retrieve a single resource item.

add

Add a new item to the resource.

edit

Edit a resource item.

delete

Remove a resource item.

Some resources may not support the full set of methods. If a method is not implemented, the API will return 405 Not Allowed. Detailed method descriptions can be found in the specific resource documentation.

Standard Optional Parameters

Methods index and view (fields only) support a set of standard parameters for convenient data selection:

limit — number of displayed items. Default: 10. Range: 1–100.

If the value is outside the allowed range, the default value is applied.

page — page number. Invalid numbers fall back to default (1).

fields — JSON string containing an array of fields:

["key1","key2", ...]

filter — JSON string containing an object like:

{"key1":"value1","key2":"value2", ...}

Filtering is applied by exact match with system data.

sort_field — field used for sorting. Default: id.

sort_direction — sorting order:

1 — ascending

-1 — descending

Default: ascending.

Allowed fields and values for each parameter can be found in the specific resource documentation.

Possible HTTP Response Status Codes

Code

Description

Successful Responses

200 OK

Successful request (used in index and view).

201 Created

A new resource was successfully created (used in add).

204 No Content

Request processed successfully; no response body (used in edit and delete).

Client Errors

400 Bad Request

Syntax error or invalid/missing parameters.

401Unauthorized

Authentication required; missing or incorrect X-Estis-Auth header.

404 Not Found

The requested resource does not exist.

405 Not Allowed

The requested method is not allowed for this resource.

PHP Example
Example of retrieving the list of subscriber groups, where $apiKey is your API key.

$apiKey = 'sdfhdsgfhjsgdbjhvshfkywjhgfksdjfhbkjds';
$resourceUrl = 'https://v1.estismail.com/mailer/lists';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $resourceUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
	'X-Estis-Auth: '.$apiKey
));
$response = curl_exec($ch);
curl_close($ch);