### Users index method response example Source: https://estismail.com/api/section/mailer/users Example of a successful response for the index method of the Users resource. The response contains a user object with fields login, email, name, and lastname. Note that the example shows a missing comma after the login field, which is a syntax error in JSON. ```json { "user": [ { "login": "example" "email": "email@example.com", "name": "Test", "lastname": "Last", } ] } ``` -------------------------------- ### Successful Response Example for GET /mailer/sends/[id] Source: https://estismail.com/api/section/mailer/sends The JSON response returned upon a successful request, containing the mailing details. ```json { "id": 1, "letter_title": "letter_title", "maket_id": 10, "count": 1, "status": 4, "sender_email_id": 2, "date": 1474711779, "included_lists": [ 1 ], "excluded_lists": [ ] } ``` -------------------------------- ### Index response example (JSON) Source: https://estismail.com/api/section/mailer/sends Example JSON response for the index method, showing a list of sends with their properties such as id, maket_id, count, date, included_lists, excluded_lists, status, sender_email_id, and letter_title. ```json { "sends": [ { "id": 1, "maket_id": 1, "count": 1, "date": 1475169822, "included_lists": [ 19 ], "excluded_lists": [ ], "status": 0, "sender_email_id": 5, "letter_title": "letter_title" }, { "id": 2, "maket_id": 13, "count": 1, "date": 1475173053, "included_lists": [ 127 ], "excluded_lists": [ ], "status": 0, "sender_email_id": 3, "letter_title": "letter_title" }, { ... } ] } ``` -------------------------------- ### Example successful response for GET /mailer/lists Source: https://estismail.com/api/section/mailer/lists Shows the JSON structure returned when the index method succeeds. The response contains a 'lists' array with subscriber group objects, each including fields such as id, title, status, and various URLs and maket fields. ```json { "lists": [ { "id": 1, "title": "title", "about": null, "status": 1, "repeat_date": 1474884473, "use_personal_makets": 0, "subscribe_link": "https:\/\/example.com\/", "subscribe_page": "https:\/\/example.com\/", "activate_page": "http:\/\/example.com\/", "subscribe_maket": "", "subscribe_maket_title": null, "activate_maket": "", "activate_maket_title": null, "sender_email_id": 1 }, { "id": 2, "title": "title", "about": null, "status": 1, "repeat_date": 1475143473, "use_personal_makets": 0, "subscribe_link": "https:\/\/example.com\/", "subscribe_page": "https:\/\/example.com\/", "activate_page": "https:\/\/example.com\/", "subscribe_maket": "subscribe maket", "subscribe_maket_title": "title_for subscribe maket", "activate_maket": "activate maket", "activate_maket_title": "title_for activate maket", "sender_email_id": 2 }, { ... } ] } ``` -------------------------------- ### index: Successful response JSON Source: https://estismail.com/api/section/mailer/forms Example JSON response for the index method (GET /mailer/forms) with HTTP 200. Contains a forms array with id, title, list_id, and body fields. ```json { "forms": [ { "id": 1, "title": "hello", "list_id": 32, "body": "some body" } ] } ``` -------------------------------- ### view: Successful response JSON Source: https://estismail.com/api/section/mailer/forms Example JSON response for the view method (GET /mailer/forms/[id]) with HTTP 200. Contains id, title, body, and list_id fields. ```json { "id": 1, "title": "title", "body": "example", "list_id": 13451 } ``` -------------------------------- ### Successful response for view method Source: https://estismail.com/api/section/mailer/emails Example of a successful HTTP 200 response returning subscriber data in JSON format. ```json { "id": 1, "name": "name", "email": "example@example.com", "city": "Kiev", "phone": "", "date": 1475067337, "ip": "92.205.206.85", "skype": "skype_login", "status": 0, "subscribe_link": "http:\/\/example.com" } ``` -------------------------------- ### GET /mailer/forms Source: https://estismail.com/api/section/mailer/forms Метод index используется для получения списка форм подписки. ```APIDOC ## [GET] /mailer/forms ### Description Используется для получения списка форм подписки. ### Method GET ### Endpoint /mailer/forms ### Parameters #### Query Parameters - **fields** (array of string) - Optional - Значения по умолчанию: ["id","title"]. Список доступных полей: id, title, list_id, body. Если переданы неправильные параметры, вернётся значение по умолчанию. ### Response #### Success Response (200) - **forms** (array) - Список форм подписки. - **id** (int) - Идентификатор пользователя. - **title** (string) - Название формы подписки. - **list_id** (int) - Идентификатор группы подписчиков. - **body** (string) - Тело формы. #### Response Example ``` { "forms": [ { "id": 1, "title": "hello", "list_id": 32, "body": "some body" } ] } ``` ``` -------------------------------- ### GET /mailer/makets Source: https://estismail.com/api/section/mailer/makets Retrieves a list of user's makets (email templates). Supports optional fields, filter, and sorting parameters. ```APIDOC ## GET /mailer/makets ### Description Retrieves a list of user's makets (email templates). Supports optional fields, filter, and sorting parameters. ### Method GET ### Endpoint /mailer/makets ### Parameters #### Query Parameters - **fields** (array of strings) - Optional - Default: ["id","title"]. Available fields: id, title, body. If invalid parameters are passed, the default value is returned. - **filter** (object) - Optional - Available filter fields: title. - **sort_field** (string) - Optional - Default: id. Available sort fields: id, title. ### Response #### Success Response (200) - **makets** (array of objects) - List of makets. - **id** (int) - Identifier of the maket. - **title** (string) - Title of the maket. - **body** (string) - Body of the maket. #### Response Example ```json { "makets": [ { "id": 1, "title": "title", "body": "" }, { "id": 2, "title": "title", "body": "" } ] } ``` ``` -------------------------------- ### GET /mailer/makets/[id] Source: https://estismail.com/api/section/mailer/makets Retrieves a single maket by its unique identifier (id). Supports optional fields parameter. ```APIDOC ## GET /mailer/makets/[id] ### Description Retrieves a single maket by its unique identifier (id). Supports optional fields parameter. ### Method GET ### Endpoint /mailer/makets/[id] ### Parameters #### Path Parameters - **id** (int) - Required - Identifier of the maket. #### Query Parameters - **fields** (array of strings) - Optional - Default: ["id","title"]. Available fields: id, title, body. ### Response #### Success Response (200) - **id** (int) - Identifier of the maket. - **title** (string) - Title of the maket. - **body** (string) - Body of the maket. #### Response Example ```json { "id": 1, "title": "title", "body": "" } ``` ### Errors | Code | Error Code | Text | Description | |------|------------|------|-------------| | 400 | 20220 | Invalid fields. Wrong parameters of string fields | Invalid fields parameter passed. | | 404 | - | Not found | Maket with the given id not found. | ``` -------------------------------- ### GET /mailer/lists/[id] Source: https://estismail.com/api/section/mailer/lists Документация метода view для получения группы подписчиков по идентификатору. ```APIDOC ## [GET] /mailer/lists/[id] ### Description Используется для получения группы подписчиков по уникальному идентификатору (id). ### Method GET ### Endpoint /mailer/lists/[id] ### Parameters #### Query Parameters - **fields** (string) - Optional - Строка в формате json, содержащая массив полей, которые необходимо получить для конкретного подписчика. Список доступных полей: id, title, about, status, subscribe_page, activate_page, repeat_date, subscribe_link, subscribe_maket, subscribe_maket_title, activate_maket, activate_maket_title, use_personal_makets, sender_email_id. Значение по умолчанию: ["id","title"]. ### Response #### Success Response (200) - **id** (int) - Идентификатор группы подписчиков. - **title** (string) - Название группы подписчиков. - **about** (string) - Краткое описание группы подписчиков. - **status** (int) - 1 - активна. 0 - заблокирована. -1 - на модерации. - 2 - заблокирована администратором. - **subscribe_page** (string) - Страница, на которую происходит переадресация после заполнения формы подписки. Если пустая, то используется страница Estismail по умолчанию. - **activate_page** (string) - Страница, на которую происходит переадресация после перехода на ссылку активации. Если пустая, то используется страница Estismail по умолчанию. - **subscribe_link** (string) - Страница, с которой подписчик перешел. - **subscribe_maket** (string) - Тело макета письма после подписки. - **subscribe_maket_title** (string) - Тема макета письма после подписки. - **activate_maket** (string) - Тело макета письма после активации. - **activate_maket_title** (string) - Тема макета письма после активации. - **repeat_date** (timestamp) - Время последней отправки письма активации. - **use_personal_makets** (int) - Флаг использования персональных макетов. Если 0 - не использовать персональные макеты. 1 - использовать. Использование персональных макетов ( установлен флаг use_personal_makets = 1 ) возможно лишь в том случае, когда заполнены поля activate_maket_title, activate_maket, subscribe_maket_title and subscribe_maket. - **sender_email_id** (int) - Email, с которого происходит отправка активационных писем. #### Response Example ```json { "id": 1, "title": "title", "about": null, "status": 1, "repeat_date": 1460039585, "use_personal_makets": 0, "subscribe_link": "https:\/\/example.com\/", "subscribe_page": "https:\/\/example.com\/", "activate_page": "https:\/\/example.com\/", "subscribe_maket": "", "subscribe_maket_title": "", "activate_maket": "", "activate_maket_title": "", "sender_email_id": 1 } ``` ### Errors - **400** - Код ошибки: 20320 - Invalid fields. Wrong parameters of string fields - Переданны неправильные параметры строки fields. - **404** - Not found - Группы подписчиков по переданому идентификатору не найдено. ``` -------------------------------- ### Example successful response for SenderEmails index Source: https://estismail.com/api/section/mailer/senderemails Shows the JSON structure returned when the index method succeeds. The response contains a sender_emails array with objects having id, email, name, approved, default, and last_approved fields. ```json { "sender_emails": [ { "id": 1, "email": "example@example.com", "name": "Name", "approved": 1, "default": 0, "last_approved": 1473937013 }, { "id": 1, "email": "email@example.com", "name": "Name", "approved": 1, "default": 0, "last_approved": 1473943131 }, { ... }, ] } ``` -------------------------------- ### SendStatistics view - successful response JSON Source: https://estismail.com/api/section/mailer/sendstatistics Example of a successful response for the view method. Returns detailed statistics including common, open_time, click_statistic, domain_statistic, and errors fields. ```json { "id": 1, "common": { "count": 1, "delivered": 1, "bounce": 0, "opened": 1, "clicked": 0, "spam": 0, "unsubs": 0 }, "open_time": { "1474279200": 1 }, "click_statistic": [ ], "domain_statistic": { "example.com": { "delivered": 1, "bounce": 0 } }, "errors": [ ] } ``` -------------------------------- ### SendStatistics index - successful response JSON Source: https://estismail.com/api/section/mailer/sendstatistics Example of a successful response for the index method. Returns a JSON object with a 'statistics' array containing objects with 'id' and 'letter_title' fields. ```json { "statistics": [ { "id": 1, "letter_title": "letter_title" }, { "id": 2, "letter_title": "letter_title" }, { ... } ] } ``` -------------------------------- ### POST /mailer/makets Source: https://estismail.com/api/section/mailer/makets Creates a new maket. Requires a title, optionally a body. ```APIDOC ## POST /mailer/makets ### Description Creates a new maket. Requires a title, optionally a body. ### Method POST ### Endpoint /mailer/makets ### Parameters #### Request Body - **title** (string) - Required - Title of the maket. - **body** (string) - Optional - Body of the maket. ### Response #### Success Response (201) - **id** (int) - Identifier of the created maket. #### Response Example ```json { "id": 1 } ``` ### Errors | Code | Error Code | Text | Description | |------|------------|------|-------------| | 400 | 20240 | Invalid title. Title can not be empty | Title cannot be empty. | ``` -------------------------------- ### add Source: https://estismail.com/api/section/mailer/senderemails Adds a new sender email. Supports a maximum of 10 sender emails. After adding, an activation email is sent to the specified address. ```APIDOC ## POST /mailer/senderemails ### Description Adds a new sender email. After adding, an activation email is sent to the specified address. The email can be activated via the link in the email or using the activation code with the edit method of the SenderEmails resource. ### Method POST ### Endpoint /mailer/senderemails ### Parameters #### Request Body - **name** (string) - Required - Sender name. - **email** (string) - Required - Sender email address. ### Response #### Success Response (201) Returns the identifier (id) of the created sender email. #### Response Example ``` { "id": 1 } ``` ### Error Handling - **400 (20440)** - Invalid name. Name can not be empty - **400 (20441)** - Invalid email. Check the validity of the specified email - **400 (20442)** - Exhausted the limit of sender emails. Maximum number: 10 - **400 (20443)** - This email already exists - **400 (20444)** - Emails on domains mail.ru, bk.ru, mail.ua, list.ru, inbox.ru can not be used - **400 (20445)** - At this tariff email should be on a personal domain ``` -------------------------------- ### GET /mailer/sends/[id] Source: https://estismail.com/api/section/mailer/sends Документация метода view для получения рассылки по идентификатору. ```APIDOC ## GET /mailer/sends/[id] ### Description Используется для получения рассылки по уникальному идентификатору (id). ### Method GET ### Endpoint /mailer/sends/[id] ### Parameters #### Path Parameters - **id** (int) - Required - Идентификатор рассылки. #### Query Parameters - **fields** (array) - Optional - Список полей для возврата. Значение по умолчанию: ["id","letter_title"]. Доступные поля: id, maket_id, count, date, status, sender_email_id, included_lists, excluded_lists, letter_title. ### Response #### Success Response (200) - **id** (int) - Идентификатор рассылки. - **maket_id** (int) - Идентификатор используемого макета. - **count** (int) - Количество email адресов, участвующих в рассылке. - **status** (int) - Состояние рассылки. Статус: 0 - назначена на время; 1 - рассылается; 2 - сбор статистики; 3 - уточнение статистики; 4 - завершена. - **included_lists** (array) - Массив, содержащий группы подписчиков, участвующие в рассылке. - **excluded_lists** (array) - Массив, содержащий группы подписчиков, которые исключены из рассылки. - **sender_email_id** (int) - Идентификатор выбранного email-a отправителя. - **date** (timestamp) - Дата начала рассылки. - **letter_title** (string) - Тема письма. #### Response Example ```json { "id": 1, "letter_title": "letter_title", "maket_id": 10, "count": 1, "status": 4, "sender_email_id": 2, "date": 1474711779, "included_lists": [ 1 ], "excluded_lists": [ ] } ``` ### Errors | HTTP Status | Error Code | Error Text | Description | |---|---|---|---| | 400 | 20520 | Invalid arguments. Wrong parameters of string fields | Переданны неправильные параметры строки fields. | | 404 | | Not found | Рассылки по переданому идентификатору не найдено. | ``` -------------------------------- ### GET /mailer/sendstatistics Source: https://estismail.com/api/section/mailer/sendstatistics Retrieves a list of mailings (send statistics). Supports optional sorting by the id field. ```APIDOC ## GET /mailer/sendstatistics ### Description Retrieves a list of mailings (send statistics). Supports optional sorting by the id field. ### Method GET ### Endpoint /mailer/sendstatistics ### Parameters #### Query Parameters - **sort_field** (string) - Optional - Default: "id". Available fields for sorting: id. ### Response #### Success Response (200) Returns a JSON object with a "statistics" array containing objects with fields: - **id** (int) - Identifier of the mailing. - **letter_title** (string) - Subject of the letter. #### Response Example ```json { "statistics": [ { "id": 1, "letter_title": "letter_title" }, { "id": 2, "letter_title": "letter_title" } ] } ``` ``` -------------------------------- ### GET /mailer/forms/[id] Source: https://estismail.com/api/section/mailer/forms Метод view используется для получения формы по уникальному идентификатору (id). ```APIDOC ## [GET] /mailer/forms/[id] ### Description Используется для получения формы по уникальному идентификатору (id). ### Method GET ### Endpoint /mailer/forms/[id] ### Parameters #### Path Parameters - **id** (int) - Required - Уникальный идентификатор формы. #### Query Parameters - **fields** (array of string) - Optional - Значение по умолчанию: ["id","title"]. Список доступных полей: id, title, body, list_id. ### Response #### Success Response (200) - **id** (int) - Идентификатор формы. - **title** (string) - Название формы. - **body** (string) - Тело формы. - **list_id** (int) - Идентификатор группы подписчиков. #### Response Example ``` { "id": 1, "title": "title", "body": "example", "list_id": 13451 } ``` ### Errors #### 400 - **Код ошибки**: 20720 - **Текст ответа**: Invalid fields. Wrong parameters of string fields - **Описание**: Переданны неправильные параметры строки fields. #### 404 - **Текст ответа**: Not found - **Описание**: Формы по переданому идентификатору не найдено. ``` -------------------------------- ### GET /mailer/users Source: https://estismail.com/api/section/mailer/users Retrieves account data for the authenticated user. Supports optional fields parameter to specify which fields to return. ```APIDOC ## GET /mailer/users ### Description Retrieves account data for the authenticated user. Supports optional fields parameter to specify which fields to return. ### Method GET ### Endpoint /mailer/users ### Parameters #### Query Parameters - **fields** (array of strings) - Optional - List of fields to return. Default: ["login"]. Available fields: login, email, name, lastname. If invalid parameters are passed, the default value is used. ### Response #### Success Response (200) Returns the requested user data in JSON format. #### Response Example ```json { "user": [ { "login": "example", "email": "email@example.com", "name": "Test", "lastname": "Last" } ] } ``` #### Response Fields - **login** (string) - User login. - **email** (string) - User email. - **name** (string) - User first name. - **lastname** (string) - User last name. ``` -------------------------------- ### POST /mailer/emails Source: https://estismail.com/api/section/mailer/emails Adds a new subscriber to a specified subscriber group. Requires email and list_id, with optional fields for name, city, phone, skype, subscribe_link, ip, and activation_letter. ```APIDOC ## POST /mailer/emails ### Description Adds a new subscriber to a specified subscriber group identified by list_id. Optionally, you can provide a subscription link, IP address, and a flag to send an activation letter. ### Method POST ### Endpoint /mailer/emails ### Parameters #### Required Parameters - **email** (string) - Required - Email of the new subscriber. - **list_id** (int) - Required - Identifier of the subscriber group to which the new subscriber is added. #### Optional Parameters - **name** (string) - Optional - Subscriber's name. - **city** (string) - Optional - City of residence. - **phone** (string) - Optional - Phone number. - **skype** (string) - Optional - Skype account. - **subscribe_link** (string) - Optional - Subscription link. - **ip** (string) - Optional - IP address of the subscriber. - **activation_letter** (int) - Optional - Flag to send activation letter. 1 - send, 0 - do not send. If 0, subscriber is immediately active. Default: 1. ### Request Example { "email": "user@example.com", "list_id": 1, "name": "John Doe", "city": "New York", "phone": "+1234567890", "skype": "john.doe", "subscribe_link": "https://example.com/subscribe", "ip": "192.168.1.1", "activation_letter": 1 } ### Response #### Success Response (201) - **id** (int) - Identifier of the new subscriber. #### Response Example { "id": 1 } ### Errors | HTTP Status | Error Code | Response Text | Description | |-------------|------------|---------------|-------------| | 400 | 20140 | Invalid email. Check the validity of the specified email | Email cannot be empty and must be valid. | | 400 | 20141 | Invalid list_id. List with specified id does not exist | The provided list_id does not exist. | | 400 | 20142 | This email is already subscribed | The provided email is already in the selected subscriber group. | | 400 | 20143 | Data is not received | Data was not received. | | 400 | 20144 | Group is not found | Subscriber group not found. | | 400 | 20145 | Subscription error | Subscription error. | ``` -------------------------------- ### PUT /mailer/makets/[id] Source: https://estismail.com/api/section/mailer/makets Edits an existing maket. Optional parameters allow updating title and body. ```APIDOC ## PUT /mailer/makets/[id] ### Description Edits an existing maket. Optional parameters allow updating title and body. ### Method PUT ### Endpoint /mailer/makets/[id] ### Parameters #### Path Parameters - **id** (int) - Required - Identifier of the maket. #### Request Body - **title** (string) - Optional - New title of the maket. - **body** (string) - Optional - New body of the maket. ### Response #### Success Response (204) No content. ### Errors | Code | Error Code | Text | Description | |------|------------|------|-------------| | 400 | 20260 | Invalid title. Title can not be empty | Title cannot be empty. | | 404 | - | Not Found | Maket with the given id not found. | ``` -------------------------------- ### GET /mailer/senderemails Source: https://estismail.com/api/section/mailer/senderemails Retrieves a list of all sender emails. Supports optional parameters for pagination, field selection, filtering, and sorting. ```APIDOC ## GET /mailer/senderemails ### Description Retrieves a list of all sender emails. Supports optional parameters for pagination, field selection, filtering, and sorting. ### Method GET ### Endpoint /mailer/senderemails ### Parameters #### Query Parameters - **limit** (int) - Optional - Number of values to return, default is 10. - **page** (int) - Optional - Page number, only the first page is present with all sender emails. - **fields** (array) - Optional - List of fields to return, default is ["id","email"]. Available fields: id, email, name, approved, default, last_approved. If invalid parameters are passed, the default value is returned. - **filter** (object) - Optional - Filter criteria. Available fields: email, approved, default. - **sort_field** (string) - Optional - Field to sort by, default is id. Available fields: id, email, approved. ### Response #### Success Response (200) Returns the requested data in JSON format. #### Response Example ```json { "sender_emails": [ { "id": 1, "email": "example@example.com", "name": "Name", "approved": 1, "default": 0, "last_approved": 1473937013 }, { "id": 1, "email": "email@example.com", "name": "Name", "approved": 1, "default": 0, "last_approved": 1473943131 } ] } ``` ### Response Fields - **id** (int) - Identifier of the sender email. - **email** (string) - Email address of the sender. - **name** (string) - Name of the sender. - **approved** (int) - Approval status of the sender email. 1 - email approved, 0 - email not approved. - **default** (int) - Default email flag. 1 - set as default email, 0 - not set as default email. - **last_approved** (timestamp) - Time of the last activation email sent for this email. ``` -------------------------------- ### POST /mailer/lists Source: https://estismail.com/api/section/mailer/lists Creates a new subscriber group. Allows specifying custom pages for redirects after activation and subscription, setting the sender email for activation messages, and enabling personal email templates. ```APIDOC ## POST /mailer/lists ### Description Creates a new subscriber group. Allows specifying custom pages for redirects after activation and subscription, setting the sender email for activation messages, and enabling personal email templates. ### Method POST ### Endpoint /mailer/lists ### Parameters #### Required Parameters - **title** (string) - Required - Name of the subscriber group. - **subscribe_link** (string) - Required - Page from which the subscriber came. #### Optional Parameters - **about** (string) - Optional - Short description of the subscriber group. - **subscribe_page** (string) - Optional - Page to redirect after subscription form submission. If empty, default Estismail page is used. - **activate_page** (string) - Optional - Page to redirect after activation link click. If empty, default Estismail page is used. - **subscribe_maket** (string) - Optional - Body of the email template after subscription. - **subscribe_maket_title** (string) - Optional - Subject of the email template after subscription. - **activate_maket** (string) - Optional - Body of the email template after activation. - **activate_maket_title** (string) - Optional - Subject of the email template after activation. - **use_personal_makets** (int) - Optional - Flag to use personal templates. 0 - do not use, 1 - use. Only allowed when activate_maket_title, activate_maket, subscribe_maket_title, and subscribe_maket are filled. - **sender_email_id** (int) - Optional - Email ID from which activation emails are sent. ### Request Example ```json { "title": "My Group", "subscribe_link": "https://example.com/subscribe", "about": "A test group", "subscribe_page": "https://example.com/thanks", "activate_page": "https://example.com/activated", "subscribe_maket": "

Thanks for subscribing!

", "subscribe_maket_title": "Welcome", "activate_maket": "

Your subscription is active.

", "activate_maket_title": "Activation", "use_personal_makets": 1, "sender_email_id": 5 } ``` ### Response #### Success Response (201) - **id** (int) - Identifier of the created subscriber group. #### Response Example ```json { "id": 1 } ``` ### Errors | HTTP Status | Error Code | Message | Description | |-------------|------------|---------|-------------| | 400 | 20340 | Invalid title. Title can not be empty | Group title cannot be empty. | | 400 | 20341 | Invalid subscribe_link. URL must be existing | Link cannot be empty and must be existing. | | 400 | 20342 | You can use personal makets, only when activate_maket_title, activate_maket, subscribe_maket_title and subscribe_maket are not empty | Personal templates can only be used when all four template fields are filled. | ```