### 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": "

Hello World

" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the newly created template. #### Response Example ```json { "data": { "id": "tpl_12345abcde" } } ``` ``` -------------------------------- ### Client Libraries Source: https://dashamail.ru/api.php Information about available client libraries for interacting with the Dashamail API. ```APIDOC ## Client Libraries Dashamail provides client libraries to simplify API integration: - **Language**: PHP - **Library**: PHPDasha - **Author**: Zhussupov Zhassulan - **GitHub Repository**: https://github.com/DashaMail/php_dashamail - **Language**: Python - **Library**: dasha_python - **Author**: Zubakin Alexander - **GitHub Repository**: https://github.com/DashaMail/dasha_python If you have or want to develop a library, please contact support@dashamail.ru. ``` -------------------------------- ### lists.upload Source: https://dashamail.ru/api_details?method=lists.upload Imports subscribers from a file into a specified list. ```APIDOC ## POST /lists/upload ### Description Imports subscribers from a file into a specified list. Supports various file formats and allows for updating existing records. ### Method POST ### Endpoint /lists/upload ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **list_id** (int) - Required - The ID of the address book to import subscribers into. - **file** (string) - Required - The URL of the file to import. - **email** (int) - Required - The column number in the import file containing email addresses (0-indexed). - **merge_1** (int) - Optional - The column number for the first merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_2** (int) - Optional - The column number for the second merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_3** (int) - Optional - The column number for the third merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_4** (int) - Optional - The column number for the fourth merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_5** (int) - Optional - The column number for the fifth merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_6** (int) - Optional - The column number for the sixth merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_7** (int) - Optional - The column number for the seventh merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_8** (int) - Optional - The column number for the eighth merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_9** (int) - Optional - The column number for the ninth merge field (0-indexed). Required if the field is mandatory in the address book. - **merge_10** (int) - Optional - The column number for the tenth merge field (0-indexed). Required if the field is mandatory in the address book. - **gender** (enum) - Optional - Subscriber's gender. Possible values: 'm' (male), 'f' (female), 'n' (unknown). - **type** (string) - Required - The extension of the file to import (e.g., "xls", "csv", "xlsx", "xml", "ods", "slk", "gnumeric"). - **update** (string) - Optional - If set (e.g., "true"), existing records will be updated. - **sheet_index** (int) - Optional - The index of the sheet in an XLS file (defaults to the first sheet). - **sheet_name** (string) - Optional - The name of the sheet in an XLS file (defaults to the first sheet). ### Request Example ```json { "list_id": 123, "file": "http://example.com/subscribers.csv", "email": 0, "merge_1": 1, "type": "csv", "update": "true" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "status": "success", "message": "File uploaded and processed successfully." } ``` ``` -------------------------------- ### General API Request Structure Source: https://dashamail.ru/api Explains the base URL, authentication requirements, and request format for interacting with the DashaMail API. ```APIDOC ## General API Usage ### Description All API requests are performed via HTTP GET or POST methods to the base URL. Requests must include the method name and a valid API key. ### Endpoint https://api.dashamail.ru/ ### Parameters #### Query Parameters - **method** (string) - Required - The API method to call (e.g., 'lists.get') - **api_key** (string) - Required - Authentication key from Account > Integrations - **format** (string) - Optional - Response format: JSON (default), JSONP, or XML ### Response #### Success Response (200) - **msg** (object) - Contains err_code (0 for success), text, and type - **data** (object) - The requested data payload ``` -------------------------------- ### GET reports.sent Source: https://dashamail.ru/api_details?method=reports.sent Retrieves a list of sent emails for a specific campaign with optional pagination and sorting. ```APIDOC ## GET reports.sent ### Description Returns a list of sent emails in a specific campaign. ### Method GET ### Endpoint reports.sent ### Parameters #### Query Parameters - **campaign_id** (int) - Required - ID of the requested campaign - **start** (int) - Optional - Number of the record to start from. Defaults: 0 - **limit** (int) - Optional - Number of records to output. Defaults: 100 - **order** (string) - Optional - Field and order for sorting (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) - Description of the bounce_code - **email** (string) - Recipient email - **sent_time** (string) - Delivery time - **open_time** (string) - Open time - **click_time** (string) - Click time ``` -------------------------------- ### lists.get Source: https://dashamail.ru/api_details?method=lists.get Retrieves a list of user's address books with their details. ```APIDOC ## GET /lists.get ### Description Retrieves a list of user's address books with their details. ### Method GET ### Endpoint /lists.get ### Parameters #### Query Parameters - **list_id** (int) - Optional - ID of the requested address book. ### Response #### Success Response (200) - **data** (array) - An array of address book strings with various parameters. Nested arrays are implied to be serialized. - **id** (int) - ID of the address book. - **name** (string) - Name of the address book. - **state** (string) - Status of the address book. Possible values: active, blocked (if import is in progress), archived. - **merge_{1..10}** (array) - Serialized arrays of additional field settings. See merge_add, merge_update methods for details. - **title** (string) - Title of the additional field. - **type** (string) - Field type. Possible values: text, date, choice. - **req** (string) - Is the field required? Possible values: on, off. - **var** (string) - Template variable name. - **description** (string) - Description of how a subscriber can end up in this list. - **company** (string) - Name of your company owning the address book. - **abuse_name** (string) - Name of the person to complain to about spam. - **phone** (string) - Contact phone number. - **address** (string) - Contact address. - **city** (string) - City where your company is located. - **url** (string) - URL of your website where users can subscribe/unsubscribe from the list. - **count_active** (int) - Number of active subscribers in the list. - **count_bounced** (int) - Number of hard bounces in the list. - **count_inactive** (int) - Number of inactive subscribers in the list. - **count_unconfirmed** (int) - Number of unconfirmed addresses in the list. - **count_unsubscribed** (int) - Number of unsubscribed subscribers in the list. - **count_all** (int) - Total number of subscribers in the list. - **count** (json) - JSON array with aggregated subscriber statistics in the address book. - **stat** (json) - JSON array with aggregated statistics of mailings (opens, clicks, etc.) for this address book. #### Response Example ```json { "data": [ { "id": 123, "name": "Example List", "state": "active", "merge_1": [ { "title": "First Name", "type": "text", "req": "on", "var": "FNAME", "description": "Subscriber's first name" } ], "company": "Example Corp", "abuse_name": "Spam Complaint Dept", "phone": "+1234567890", "address": "123 Main St", "city": "Anytown", "url": "http://example.com/subscribe", "count_active": 1000, "count_bounced": 10, "count_inactive": 5, "count_unconfirmed": 2, "count_unsubscribed": 50, "count_all": 1067, "count": [{"total": 1067, "active": 1000, "bounced": 10, "inactive": 5, "unconfirmed": 2, "unsubscribed": 50}], "stat": [{"sent": 1200, "delivered": 1150, "opened": 600, "clicked": 300, "bounced": 10, "unsubscribed": 50, "complained": 1, "spam": 0}] } ] } ``` ``` -------------------------------- ### Account API Source: https://dashamail.ru/api.php Methods for managing account-level information. ```APIDOC ## GET account.get_balance ### Description Retrieves the current account balance. ``` -------------------------------- ### General API Usage Source: https://dashamail.ru/api.php Information on how to make requests to the Dashamail API, including the base URL, supported protocols, character encoding, and required parameters. ```APIDOC ## General API Usage ### Description Interact with the Dashamail API by sending HTTP requests (GET, POST) to the following address: `api.dashamail.ru`. You can use either HTTP or HTTPS protocols. The character encoding must be UTF-8. ### Base URL `https://api.dashamail.ru/` ### Required Parameters - **method** (string) - Required - The method to be called, in the format 'category.method' (e.g., 'lists.get'). - **api_key** (string) - Required - Your API key for authentication, found in the 'Account' - 'Integrations' section. ### Data Formats Specify the desired response format using the **format** parameter: - JSON (default) - JSONP - XML ### Response Structure Dashamail returns data structured as follows: - **** (array) - Contains information about the operation's execution. Includes: - **err_code** (integer) - Error code (0 indicates no errors). - **text** (string) - Textual description of the message. - **type** (string) - Message type ('message' for no errors, 'notice' or 'error' for errors). - **** (any) - The requested data, if available. ``` -------------------------------- ### POST /campaigns/attach Source: https://dashamail.ru/api_details?method=campaigns.attach Attaches a file to a campaign. You can optionally specify a name for the attached file. ```APIDOC ## POST /campaigns/attach ### Description Attaches a file to a campaign. You can optionally specify a name for the attached file. ### Method POST ### Endpoint /campaigns/attach ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **campaign_id** (int) - Required - The ID of the campaign to which the attachment will be added. - **url** (string) - Required - The URL of the file to attach. - **name** (string) - Optional - The name of the file after uploading. Useful for dynamically generated content. Include the file extension. ### Request Example ```json { "campaign_id": 12345, "url": "http://example.com/attachment.pdf", "name": "MyReport.pdf" } ``` ### Response #### Success Response (200) - **id** (int) - The ID of the attached file. #### Response Example ```json { "data": { "id": 67890 } } ``` ``` -------------------------------- ### campaigns.get_folders Source: https://dashamail.ru/api_details?method=campaigns.get_folders Retrieves campaign folders based on optional name or ID. ```APIDOC ## GET campaigns.get_folders ### Description Retrieves campaign folders. You can filter by folder name or ID. ### Method GET ### Endpoint /campaigns/get_folders ### Parameters #### Query Parameters - **name** (string) - Optional - The name of the folder to filter by. - **id** (int) - Optional - The ID of the folder to filter by. ### Response #### Success Response (200) - **data** (array) - An array of campaign folders. - **id** (int) - The ID of the folder. - **name** (string) - The name of the folder. #### Response Example ```json { "data": [ { "id": 123, "name": "My Folder" } ] } ``` ```