| Method | upload.emails |
|---|---|
| Description | Downloading emails |
| Available to | Agent, Client |
| Necessary components for working with the method | Email tracking |
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Authentication session key | |
user_id |
number | no | Unique user identifier of the agent client on behalf of which the request is made Is required for the agentTo obtain a list of client users, you must use the method "get.customer_users" |
|
emails |
array | no | Array of letters | |
site_id |
number | no | Site ID. Method for getting a list of existing sites: "get.sites" | |
session_id |
number | no | Session ID | |
source_id |
number | no | Source ID. Method for getting a list of existing Sources: "get.get_sources" | |
date_time |
date | yes | Date and time of receipt of the letter by email in the client's time zone | |
sender_name |
string | no | Sender's name | |
subject |
string | no | Email subject | |
message |
string | yes | Text of the letter. | |
message_html |
string | yes | HTML emails. | |
email_from |
string | yes | Sender. | |
email_to |
string | yes | Recipient. One of the fields is required: email_to, email_to_cc, email_to_bcc | |
email_to_cc |
array | no | Copy. | |
email_to_bcc |
array | no | Bcc. |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Description |
|---|---|---|---|---|---|
id |
number | yes | Unique identifier of the downloaded letter |
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"upload.emails", "params":{ "access_token":"string", "user_id":"number", "emails":[ { "date_time": "2023-02-16 00:00:00", "session_id": 122343, "source_id": -999, "site_id": 258, "sender_name": "Имя", "subject": "Тема", "message": "Сообщение", "message_html": "HTML", "email_from": "email_from@gmail.com", "email_to": "email_to@gmail.com", "email_to_cc": ["email_cc@gmail.com"], "email_to_bcc": ["email_bcc@gmail.com"] } ]
} }
### JSON response structure```json
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {
},
"data": [
{
"id": "number"
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"