Import multiple mailboxes
Connection settings for the server source that Yandex.Mail for Domain should use. You can check the validity of the settings using a separate request.
If the connection cannot be made using the settings you pass, Yandex.Mail for Domain will keep repeating the connection attempt for a long time without returning errors.
- A file with a list of usernames and passwords of the mailboxes to import.
- The username must:
must contain only Latin letters, numbers, dashes, or dots.
start with a letter, end with a letter or number, and be no longer than 30 characters.
- The password must:
contain from 6 to 20 characters — Latin letters, numbers, and the symbols “!”, “@”, “#”, “$”, “%”, “^”, “&”, “*”, “(”, “)”, “_”, “-”, “+”, “:”, “;”, “,”, “.”
be different from the username.
If the username or password on the server source does not meet the Yandex requirements, you should specify a new one.
Request syntax
The request should be sent over the HTTPS protocol using the POST method with the content type multipart/form-data
.
POST /api2/admin/import/start_import_file?
domain=<mail domain name>
&method=<server protocol>
&server=<server name>
&port=<server port>
&ssl=<SSL usage>
Host: pddimp.yandex.ru
Accept: */*
PddToken: <PDD token>
Content-Type: multipart/form-data; boundary=---------------some-boundary-string-of-your-choice
---------------some-boundary-string-of-your-choice
Content-Disposition: form-data; name="file"; filename="import_list_file"
<file contents — list of mailbox usernames and passwords>
---------------some-boundary-string-of-your-choice
Headers:
Name | Description |
---|---|
PddToken | |
Content-Type | Specify the type |
Content-Disposition | Specify the Each line of the file must contain the username and password of a single mailbox, separated by a space. A password on the server source that contains spaces must be enclosed in quotation marks ("): If the username or password on the server source does not meet the Yandex requirements, you should specify a new one in the line in the file, in the following format: |
Name | Description |
---|---|
PddToken | |
Content-Type | Specify the type |
Content-Disposition | Specify the Each line of the file must contain the username and password of a single mailbox, separated by a space. A password on the server source that contains spaces must be enclosed in quotation marks ("): If the username or password on the server source does not meet the Yandex requirements, you should specify a new one in the line in the file, in the following format: |
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
method | String | Server protocol. Possible values:
|
ssl | String | Use of SSL. Possible values:
|
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
method | String | Server protocol. Possible values:
|
ssl | String | Use of SSL. Possible values:
|
POST /api2/registrar/import/start_import_file?
domain=<mail domain name>
&method=<server protocol>
&server=<server name>
&port=<server port>
&ssl=<SSL usage>
Host: pddimp.yandex.ru
Accept: */*
PddToken: <PDD token>
Authorization: OAuth <OAuth token>
Content-Type: multipart/form-data; boundary=---------------some-boundary-string-of-your-choice
---------------some-boundary-string-of-your-choice
Content-Disposition: form-data; name="file"; filename="import_list_file"
<file contents — list of mailbox usernames and passwords>
---------------some-boundary-string-of-your-choice
Headers:
Name | Description |
---|---|
PddToken | |
Authorization | |
Content-Type | Specify the type |
Content-Disposition | Specify the Each line of the file must contain the username and password of a single mailbox, separated by a space. A password on the server source that contains spaces must be enclosed in quotation marks ("): If the username or password on the server source does not meet the Yandex requirements, you should specify a new one in the line in the file, in the following format: |
Name | Description |
---|---|
PddToken | |
Authorization | |
Content-Type | Specify the type |
Content-Disposition | Specify the Each line of the file must contain the username and password of a single mailbox, separated by a space. A password on the server source that contains spaces must be enclosed in quotation marks ("): If the username or password on the server source does not meet the Yandex requirements, you should specify a new one in the line in the file, in the following format: |
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
method | String | Server protocol. Possible values:
|
ssl | String | Use of SSL. Possible values:
|
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
method | String | Server protocol. Possible values:
|
ssl | String | Use of SSL. Possible values:
|
Request example
POST /api2/admin/import/start_import_file?domain=domain.com&method=pop&server=pop.yandex.ru&port=110&ssl=no HTTP/1.1
Host: pddimp.yandex.ru
Accept: */*
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
Content-Type: multipart/form-data; boundary=----------------------------60f093b65ad7
----------------------------60f093b65ad7
Content-Disposition: form-data; name="file"; filename="import_list_file"
Content-Type: text/plain
external_login1 external_password1
external_login2 external_password2
external_login3
external_login4 external_password4 internal_login4 internal_password4
----------------------------60f093b65ad7
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -F 'import_list_file=@importfilename' 'https://pddimp.yandex.ru/api2/admin/import/start_import_file?domain=domain.name&method=pop&server=pop.yandex.ru&port=110&ssl=no'
POST /api2/admin/import/start_import_file?domain=domain.com&method=pop&server=pop.yandex.ru&port=110&ssl=no HTTP/1.1
Host: pddimp.yandex.ru
Accept: */*
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000
Content-Type: multipart/form-data; boundary=----------------------------60f093b65ad7
----------------------------60f093b65ad7
Content-Disposition: form-data; name="file"; filename="import_list_file"
Content-Type: text/plain
external_login1 external_password1
external_login2 external_password2
external_login3
external_login4 external_password4 internal_login4 internal_password4
----------------------------60f093b65ad7
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -H 'Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000' -F 'import_list_file=@importfilename' 'https://pddimp.yandex.ru/api2/admin/import/start_import_file?domain=domain.name&method=pop&server=pop.yandex.ru&port=110&ssl=no'
Response structure
{
"domain": "{mail domain name}",
"settings":
{
"method": "{server protocol}",
"server": "{server name}",
"port": "{server port}",
"ssl": "{SSL usage}"
},
"import_list":
[
{
"external_login": "{username on source server}",
"external_password": "{password on source server}",
"internal_login": "{username on Yandex.Mail for Domain}",
"internal_password": "{password on Yandex.Mail for Domain}",
"started": "{ready to start import}"
},
...
]
"success": "{status of request execution}"
}
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
settings | Object | Server source settings. |
import_ list | Array | Mailbox authentication data. Each object in the array corresponds to a single mailbox. |
success | String | Status of request execution. Possible values:
|
error | String | Error code. Included in the response if the request resulted in an error. Possible values:
|
Keys for the settings object | ||
method | String | Server protocol. Possible values:
|
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
ssl | String | Use of SSL. Possible values:
|
Keys for objects in the import_list array | ||
external_login | String | Username on the server source. |
external_password | String | Password on the server source. |
internal_login | String | Username for authenticating on Yandex.Mail for Domain. |
internal_password | String | Password for authenticating on Yandex.Mail for Domain. |
started | String | Ready to start importing. Possible values:
|
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
settings | Object | Server source settings. |
import_ list | Array | Mailbox authentication data. Each object in the array corresponds to a single mailbox. |
success | String | Status of request execution. Possible values:
|
error | String | Error code. Included in the response if the request resulted in an error. Possible values:
|
Keys for the settings object | ||
method | String | Server protocol. Possible values:
|
server | String | Server's domain name or IP address. |
port | Integer | Server port. |
ssl | String | Use of SSL. Possible values:
|
Keys for objects in the import_list array | ||
external_login | String | Username on the server source. |
external_password | String | Password on the server source. |
internal_login | String | Username for authenticating on Yandex.Mail for Domain. |
internal_password | String | Password for authenticating on Yandex.Mail for Domain. |
started | String | Ready to start importing. Possible values:
|