### Campaigns API - Get Templates Source: https://dashamail.ru/api_details?method=campaigns.get_templates Retrieves HTML templates for campaigns based on name or ID. ```APIDOC ## GET campaigns.get_templates ### Description Retrieves HTML templates for campaigns. ### Method GET ### Endpoint /campaigns/get_templates ### Parameters #### Query Parameters - **name** (string) - Optional - The name of the template. - **id** (int) - Optional - The ID of the template. ### Response #### Success Response (200) - **data** (array) - An array of templates with their parameters. - **id** (int) - The ID of the template. - **html** (string) - The HTML content of the template. ``` -------------------------------- ### GET reports.summary Source: https://dashamail.ru/api_details?method=reports.summary Retrieves a summary of statistics for a specific email campaign. ```APIDOC ## GET reports.summary ### Description Retrieves concise statistics for a specific email campaign. ### Method GET ### Endpoint reports.summary ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the requested campaign. ### Response #### Success Response (200) - **bounced** (int) - Number of bounced emails - **unsubscribed** (int) - Number of unsubscribed users - **delivered** (int) - Number of delivered messages - **sent** (int) - Number of sent messages - **clicks** (int) - Total number of clicks - **opened** (int) - Number of opened emails ``` -------------------------------- ### GET /reports/opened Source: https://dashamail.ru/api_details?method=reports.opened Retrieves a list of opened emails for a given campaign. ```APIDOC ## GET /reports/opened ### Description Retrieves a list of opened emails for a given campaign, with options for pagination and sorting. ### Method GET ### Endpoint /reports/opened ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the campaign to retrieve opened emails from. - **start** (int) - Optional - The record number to start retrieving from. Defaults to 0. - **limit** (int) - Optional - The number of records to retrieve. Defaults to 100. - **order** (string) - Optional - The field and order to sort the results by (e.g., "email desc"). ### Response #### Success Response (200) - **data** (array) - An array of opened emails, each with the following fields: - **id** (int) - The ID of the email. - **member_id** (int) - The ID of the subscriber. - **campaign_id** (int) - The ID of the campaign. - **list_id** (int) - The ID of the address book. - **bounce_code** (int) - The SMTP error code if the message bounced. - **bounce_reason** (string) - The reason for the bounce. - **email** (string) - The recipient's email address. - **sent_time** (string) - The time the email was delivered. - **open_time** (string) - The time the email was opened. - **click_time** (string) - The time a link in the email was clicked. #### Response Example ```json { "data": [ { "id": 12345, "member_id": 67890, "campaign_id": 11223, "list_id": 44556, "bounce_code": null, "bounce_reason": null, "email": "test@example.com", "sent_time": "2023-10-27 10:00:00", "open_time": "2023-10-27 10:05:00", "click_time": null } ] } ``` ``` -------------------------------- ### GET reports.clients Source: https://dashamail.ru/api_details?method=reports.clients Retrieves statistics on browsers, operating systems, and email clients for a specific email campaign. ```APIDOC ## GET reports.clients ### Description Retrieves statistics regarding browsers, operating systems, and email clients for a specific campaign. ### Method GET ### Endpoint reports.clients ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the requested campaign. ### Response #### Success Response (200) - **data** (array) - An associative array where keys are the names of browsers, OS, or clients, and values are the count of opens (only if non-zero). #### Response Example { "data": { "chrome": 150, "win": 200, "outlook": 50 } } ``` -------------------------------- ### GET account.get_balance Source: https://dashamail.ru/api_details?method=account.get_balance Retrieves the current account balance, including subscriber limits and email quotas. ```APIDOC ## GET account.get_balance ### Description Retrieves the current account balance information, including subscriber limits and available email credits. ### Method GET ### Endpoint account.get_balance ### Response #### Success Response (200) - **limit_members** (array) - Maximum number of subscribers allowed on the account (0 if unlimited). - **limit_emails** (array) - Available number of emails. - **members** (array) - Current number of unique subscribers on the account. ``` -------------------------------- ### GET reports.clicked Source: https://dashamail.ru/api_details?method=reports.clicked Retrieves a list of emails in a campaign where the recipient clicked on any link. ```APIDOC ## GET reports.clicked ### Description Returns a list of emails in a specific campaign where the recipient clicked on any link. ### Method GET ### Endpoint reports.clicked ### Parameters #### Query Parameters - **campaign_id** (int) - Required - id of the requested campaign - **start** (int) - Optional - Number of the record to start output from. Defaults: 0 - **limit** (int) - Optional - Number of records to output. Defaults: 100 - **order** (string) - Optional - Field to sort by and order (asc, desc), e.g., "email desc" ### Response #### Success Response (200) - **data** (array) - Array of emails with the following fields: - **id** (int) - id of the email - **member_id** (int) - id of the subscriber - **campaign_id** (int) - id of the campaign - **list_id** (int) - id of the address list - **bounce_code** (string) - smtp error code in case of bounce - **bounce_reason** (string) - explanation of the bounce_code - **email** (string) - recipient email - **sent_time** (string) - delivery time - **open_time** (string) - open time - **click_time** (string) - click time ``` -------------------------------- ### GET campaigns.get Source: https://dashamail.ru/api_details?method=campaigns.get Retrieves a list of user campaigns based on optional filters like status, list ID, or date range. ```APIDOC ## GET campaigns.get ### Description Retrieves a list of campaigns for the user. Supports filtering by campaign ID, status, list ID, workflow, subscriber ID, date range, type, and result limit. ### Method GET ### Endpoint campaigns.get ### Parameters #### Query Parameters - **campaign_id** (int) - Optional - ID of the requested campaign - **status** (string) - Optional - {DRAFT, SCHEDULE, MODERATING, CREATED, PROCESSING, SENT, BLOCKED, SUBSCRIBE, BLOCKED-SPAM, NEED-FIX} - Campaign status - **list_id** (int) - Optional - Filter campaigns by address list ID - **workflow** (int) - Optional - ID of the automation/flow to get campaigns contained within it - **member_id** (int) - Optional - Subscriber ID to personalize content (plain_text and html) - **start** (date) - Optional - Filter by start date (YYYY-MM-DD) - **end** (date) - Optional - Filter by end date (YYYY-MM-DD) - **type** (string) - Optional - {online_builder, html} - Campaign type - **limit** (int) - Optional - Number of records to return ### Response #### Success Response (200) - **id** (int) - Campaign ID - **external_campaign_id** (string) - External campaign ID - **channel** (string) - Channel: email, sms, viber, whatsapp, telegram, notify, push, webpush - **type** (string) - Type: online_builder, html - **status** (string) - Status: DRAFT, SCHEDULE, MODERATING, CREATED, PROCESSING, SENT, BLOCKED - **name** (string) - Campaign name - **list_id** (int) - Address list ID - **subject** (string) - Email subject - **from_name** (string) - Sender name - **from_email** (string) - Sender email - **personalizeToEmail** (string) - {on/off} - Personalization in 'To' field - **to_email** (string) - Personalization template for 'To' field - **track_opens** (string) - {Y,N} - Track opens - **track_clicks** (string) - {Y,N} - Track clicks - **plain_clicks** (string) - {Y,N} - Track clicks in plain text - **analytics** (string) - {google,N} - Analytics integration - **analytics_tag** (string) - Analytics tag - **analytics_source** (string) - utm_source - **analytics_medium** (string) - utm_medium - **analytics_content** (string) - utm_content - **analytics_term** (string) - utm_term - **html** (string) - HTML version code - **plain_text** (string) - Plain text version - **delivery_time** (date) - Scheduled delivery time - **auto** (int) - Auto-campaign status (0, 1, 2) - **limit** (int) - Sending limit - **wait_time** (int) - Wait time in seconds for partial sending - **allow_time_zone** (string) - {Y,N} - Use subscriber time zone - **allow_best_time** (string) - {Y,N} - Use 'best time' delivery - **emails_sent** (int) - Total emails sent ``` -------------------------------- ### GET reports.delivered Source: https://dashamail.ru/api_details?method=reports.delivered Retrieves a list of delivered emails for a specific campaign with optional pagination and sorting. ```APIDOC ## GET reports.delivered ### Description Returns a list of delivered emails for a specified campaign. ### Method GET ### Endpoint reports.delivered ### Parameters #### Query Parameters - **campaign_id** (int) - Required - ID of the requested campaign - **start** (int) - Optional - Number of the record to start from (default: 0) - **limit** (int) - Optional - Number of records to return (default: 100) - **order** (string) - Optional - Field and order for sorting (e.g., "email desc") ### Response #### Success Response (200) - **data** (array) - Array of email objects containing: - **id** (int) - ID of the email - **member_id** (int) - ID of the subscriber - **campaign_id** (int) - ID of the campaign - **list_id** (int) - ID of the address list - **bounce_code** (string) - SMTP error code if bounced - **bounce_reason** (string) - Description of the bounce code - **email** (string) - Recipient email - **sent_time** (string) - Delivery time - **open_time** (string) - Open time - **click_time** (string) - Click time ``` -------------------------------- ### GET lists.get_import_history Source: https://dashamail.ru/api_details?method=lists.get_import_history Retrieves the history and results of imports for a specific mailing list. ```APIDOC ## GET lists.get_import_history ### Description Retrieves the history and results of imports for a specific mailing list. ### Method GET ### Endpoint lists.get_import_history ### Parameters #### Query Parameters - **list_id** (int) - Optional - ID of the mailing list. ### Response #### Success Response (200) - **data** (array) - Array of import results containing: - **id** (int) - Import ID - **list_id** (int) - Mailing list ID - **username** (string) - Name of the user who performed the import - **message** (string) - Import result details including links to filtered, unsubscribed, blacklisted, and bounced contacts - **type** (string) - Status of the import (success, errors, in_progress) - **file_name** (string) - Name of the imported file - **time** (string) - Timestamp of the import start ``` -------------------------------- ### GET reports.bouncestat Source: https://dashamail.ru/api_details?method=reports.bouncestat Retrieves statistics on various reasons for email bounces within a specific campaign. ```APIDOC ## GET reports.bouncestat ### Description Retrieves statistics on various reasons for email bounces within a specific campaign. ### Method GET ### Endpoint reports.bouncestat ### Parameters #### Query Parameters - **campaign_id** (int) - Required - ID of the requested campaign ### Response #### Success Response (200) - **data** (array) - Array of bounce errors returned in the campaign - **bounce_code** (string) - SMTP error code - **count** (int) - Number of emails with this error - **description** (string) - Typical brief description of the error ``` -------------------------------- ### GET reports.userclicks Source: https://dashamail.ru/api_details?method=reports.userclicks Retrieves detailed statistics regarding clicks on a specific URL within a given email campaign. ```APIDOC ## GET reports.userclicks ### Description Retrieves statistics for clicks on a specified URL in an email campaign. ### Method GET ### Endpoint reports.userclicks ### Parameters #### Query Parameters - **campaign_id** (int) - Required - ID of the requested campaign - **url** (string) - Required - The URL address to track ### Response #### Success Response (200) - **data** (array) - Array containing information about all clicks for the specified URL - **url** (string) - The URL address - **email** (string) - Email address of the user who clicked - **click_time** (string) - Timestamp of the click ``` -------------------------------- ### GET /reports.events Source: https://dashamail.ru/api_details?method=reports.events Retrieves a list of events for emails within a specific campaign and time range. ```APIDOC ## GET /reports.events ### Description Lists events for emails within a specified campaign and time period. This endpoint is useful for tracking email engagement and delivery status. ### Method GET ### Endpoint /reports.events ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the campaign to retrieve events for. - **time_start** (datetime) - Optional - The start time for filtering events in 'YYYY-DD-MM HH:ii:ss' format. Defaults to the beginning of the current day. - **time_end** (datetime) - Optional - The end time for filtering events in 'YYYY-DD-MM HH:ii:ss' format. Defaults to the end of the current day. - **merge** (JSON-array) - Optional - A JSON array of merge fields to include in the results (e.g., ["merge_1","merge_3","rating"]). Can also include 'optin_time', 'rating', and 'gender'. - **email** (string) - Optional - Filter events for a specific subscriber's email address. - **start** (int) - Optional - The starting record number for pagination. Defaults to 0. - **limit** (int) - Optional - The maximum number of records to return per page. Defaults to 100. - **order** (string) - Optional - Specifies the sorting field and order (e.g., "email desc"). Accepts 'asc' or 'desc' for order. ### Response #### Success Response (200) - **data** (array) - An array of event objects, each containing details about an email event. - **event_date** (string) - The date of the event. - **event_time** (string) - The time of the event. - **event_type** (string) - The type of event (e.g., SENT, BOUNCED, OPENED, CLICKED, PREVIEW, UNSUBSCRIBED, COMPLAINED). - **bounce_category** (string) - The category of the bounce (e.g., hrd, sft, blk, spm). - **bounce_code** (string) - The delivery error code. - **bounce_reason** (string) - The description of the delivery error. - **email** (string) - The recipient's email address. - **domain** (string) - The recipient's domain. - **user_id** (int) - The client's user ID. - **campaign_id** (int) - The campaign ID. - **member_id** (int) - The subscriber's ID in Dashamail. - **list_id** (int) - The address book ID. - **url_hash** (string) - The URL hash in case of a click. - **url_pers** (string) - The personalized URL. - **url_original** (string) - The original URL from the template. - **ip** (string) - The IP address. - **ip_aton** (string) - The IP address in ATON format. - **region** (string) - The region. - **OS** (string) - The operating system. - **browser** (string) - The browser. - **webservice** (string) - The email web service. - **user_agent** (string) - The full user agent string of the device. - **referer** (string) - The referring source. - **language** (string) - The user's language setting on the device. - **device** (string) - The device type. - **dark_mode** (int) - Indicates dark mode status (0 for light, 1 for dark). #### Response Example { "data": [ { "event_date": "2023-10-27", "event_time": "10:30:00", "event_type": "OPENED", "bounce_category": null, "bounce_code": null, "bounce_reason": null, "email": "test@example.com", "domain": "example.com", "user_id": 12345, "campaign_id": 67890, "member_id": 112233, "list_id": 445566, "url_hash": null, "url_pers": null, "url_original": null, "ip": "192.168.1.1", "ip_aton": "3232235777", "region": "US", "OS": "Windows", "browser": "Chrome", "webservice": "Gmail", "user_agent": "Mozilla/5.0 (...) Chrome/91.0.4472.124 Safari/5.0", "referer": "http://example.com", "language": "en-US", "device": "Desktop", "dark_mode": 0 } ] } ``` -------------------------------- ### GET reports.clickstat Source: https://dashamail.ru/api_details?method=reports.clickstat Retrieves click statistics for various URLs within a specific email campaign. ```APIDOC ## GET reports.clickstat ### Description Retrieves statistics regarding clicks on various URLs within a specific email campaign. ### Method GET ### Endpoint reports.clickstat ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the requested email campaign. ### Response #### Success Response (200) - **data** (array) - An array of objects containing click data. - **url** (string) - The address of the link. - **clicks** (int) - The total number of clicks for this link within the campaign. ``` -------------------------------- ### lists.add Source: https://dashamail.ru/api_details?method=lists.add Adds a new address database to the user account. ```APIDOC ## lists.add ### Description Adds a new address database to the system. ### Parameters #### Request Body - **name** (string) - Required - Название создаваемой базы - **abuse_email** (string) - Optional - Email, по которому будут приниматься жалобы на спам - **abuse_name** (string) - Optional - Имя человека, которому можно жаловаться на спам - **company** (string) - Optional - Название вашей компании, владеющей адресной базой - **address** (string) - Optional - Контактный адрес - **city** (string) - Optional - Город, где находится ваша компания - **zip** (string) - Optional - Почтовый индекс - **country** (string) - Optional - Страна, где вы находитесь - **url** (string) - Optional - URL вашего сайта, где можно подписаться/отписаться на базу - **phone** (string) - Optional - Контактный телефон ### Response #### Success Response (200) - **list_id** (integer) - ID добавленной базы ``` -------------------------------- ### GET /reports.bounced Source: https://dashamail.ru/api_details?method=reports.bounced Retrieves a list of bounced emails for a specific campaign. ```APIDOC ## GET /reports.bounced ### Description Retrieves a list of bounced emails for a specific campaign. ### Method GET ### Endpoint /reports.bounced ### Parameters #### Query Parameters - **campaign_id** (int) - Required - The ID of the requested campaign. - **start** (int) - Optional - The record number to start output from. Defaults to 0. - **limit** (int) - Optional - The number of records to output. Defaults to 100. - **order** (string) - Optional - Field to sort by and order (asc, desc). Example: "email desc". ### Response #### Success Response (200) - **data** (array) - An array of emails with their parameters. - **id** (int) - The ID of the email. - **member_id** (int) - The ID of the subscriber. - **campaign_id** (int) - The ID of the campaign. - **list_id** (int) - The ID of the address book. - **bounce_code** (int) - The SMTP error code for the bounce. - **bounce_reason** (string) - The explanation of the bounce code. - **email** (string) - The recipient's email address. - **sent_time** (string) - The time the email was delivered. - **open_time** (string) - The time the email was opened. - **click_time** (string) - The time a link was clicked. ``` -------------------------------- ### Import and Activity Source: https://dashamail.ru/api.php Methods for importing subscribers and tracking subscriber activity. ```APIDOC ## POST /lists.upload ### Description Imports subscribers into an address book from a file. ### Method POST ### Endpoint /lists.upload ### Parameters #### Request Body - **list_id** (int) - Required - The ID of the address book. - **file** (string) - Required - The file containing subscriber data. - **email** (int) - Required - Column index for email address. - **merge_1** (int) - Optional - Column index for merge field 1. - **merge_2** (int) - Optional - Column index for merge field 2. - **merge_3** (int) - Optional - Column index for merge field 3. - **merge_4** (int) - Optional - Column index for merge field 4. - **merge_5** (int) - Optional - Column index for merge field 5. - **merge_6** (int) - Optional - Column index for merge field 6. - **merge_7** (int) - Optional - Column index for merge field 7. - **merge_8** (int) - Optional - Column index for merge field 8. - **merge_9** (int) - Optional - Column index for merge field 9. - **merge_10** (int) - Optional - Column index for merge field 10. - **gender** (enum) - Optional - Column index for gender. - **type** (string) - Optional - Type of import. - **update** (string) - Optional - Update existing subscribers if present. - **sheet_index** (int) - Optional - Index of the sheet to import from (for Excel files). - **sheet_name** (string) - Optional - Name of the sheet to import from (for Excel files). ### Response #### Success Response (200) - **job_id** (int) - The ID of the import job. #### Response Example { "job_id": 789 } ## GET /lists.get_import_history ### Description Retrieves the history and results of an address book import. ### Method GET ### Endpoint /lists.get_import_history ### Parameters #### Query Parameters - **list_id** (int) - Required - The ID of the address book. ### Response #### Success Response (200) - **history** (array) - A list of import job results. #### Response Example { "history": [ { "job_id": 789, "status": "completed" } ] } ## GET /lists.member_activity ### Description Retrieves the activity of a subscriber across various campaigns. ### Method GET ### Endpoint /lists.member_activity ### Parameters #### Query Parameters - **email** (string) - Required - The email address of the subscriber. - **filter** (string) - Optional - Filter activity by type (e.g., 'open', 'click'). - **start_time** (datetime) - Optional - Start of the time range for activity. - **end_time** (datetime) - Optional - End of the time range for activity. - **campaign_id** (int) - Optional - Filter activity by campaign ID. ### Response #### Success Response (200) - **activity** (array) - A list of subscriber activities. #### Response Example { "activity": [ { "campaign_id": 101, "action": "open", "timestamp": "2023-10-27T10:00:00Z" } ] } ``` -------------------------------- ### POST campaigns.get_automations Source: https://dashamail.ru/api_details?method=campaigns.get_automations Retrieves a list of all automations and workflows, with an optional filter by ID. ```APIDOC ## POST campaigns.get_automations ### Description Retrieves a list of all automations and workflows. Optionally filter by a specific automation or workflow ID. ### Method POST ### Endpoint campaigns.get_automations ### Parameters #### Request Body - **id** (int) - Optional - ID of the requested automation or workflow ### Response #### Success Response (200) - **data** (array) - Array of automations with the following fields: - **id** (int) - ID of the automation - **name** (string) - Name of the automation - **last_edit_time** (string) - Time of last edit - **priority** (int) - Priority (0 - normal, 1 - high, 2 - critical) - **type** (string) - Type (automation or workflow) ``` -------------------------------- ### POST campaigns.create Source: https://dashamail.ru/api_details?method=campaigns.create Creates a new email campaign using the specified parameters, including recipient lists, email content, and tracking settings. ```APIDOC ## POST campaigns.create ### Description Creates a new email campaign in the DashaMail system. ### Method POST ### Endpoint campaigns.create ### Parameters #### Request Body - **list_id** (serialized array) - Required - Indexed array of recipient list IDs. - **name** (string) - Optional - Name of the campaign. - **subject** (string) - Optional - Email subject line. - **from_name** (string) - Optional - Sender name. - **from_email** (string) - Optional - Sender email address. - **personalizeToEmail** (string) - Optional - {on/off} Enable/disable personalization in the 'To' field. - **to_email** (string) - Optional - Personalization string for the 'To' field. - **track_opens** (string) - Optional - {Y,N} Track email opens. - **track_clicks** (string) - Optional - {Y,N} Track link clicks. - **plain_clicks** (string) - Optional - {Y,N} Track clicks in plain text version. - **no_images_add** (string) - Optional - {0,1} Do not attach images to the email. - **analytics** (string) - Optional - {google,N} Enable Google Analytics tracking. - **analytics_tag** (string) - Optional - Tag for Google Analytics tracking. - **html** (string) - Optional - HTML content, template ID, or saved template reference. - **plain_text** (string) - Optional - Plain text version of the email. - **esegment** (serialized array) - Optional - Segment definitions for the recipient lists. ### Response #### Success Response (200) - **campaign_id** (integer) - The ID of the newly created campaign. ``` -------------------------------- ### POST campaigns.add_template Source: https://dashamail.ru/api_details?method=campaigns.add_template Adds an HTML template to your campaigns. ```APIDOC ## POST campaigns.add_template ### Description Adds an HTML template to your campaigns. ### Method POST ### Endpoint /campaigns/add_template ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the template. - **template** (string) - Required - The HTML code of the template or the ID of a campaign to copy the HTML from. ### Request Example ```json { "name": "My New Template", "template": "