Get import status

This request is used for getting information about the status of an import.

If the import was stopped due to a large number of errors, the response might have multiple pages. To get a paginated response, use the request parameters to specify the page number and the number of mailboxes per page.

  1. Request syntax
  2. Request example
  3. Response structure

Request syntax

The request should be sent over the HTTPS protocol using the GET method.

GET /api2/admin/import/check_imports?
[page=<page number in the response>]
[on_page=<number of mailboxes per response page>]

Host: pddimp.yandex.ru
PddToken: <PDD token>
...
domain=<domain name>

Headers:

Name Description
PddToken

PDD token.

Name Description
PddToken

PDD token.

Parameters:

Parameter Type Value
Mandatory
domain String

Name of the domain.

Optional
page Integer

Page number in the response. The default value is 1.

This parameter may be necessary if the response has multiple pages due to a large number of errors.

on_page Integer

Number of mailboxes with errors on each response page. The default value is 10.

This parameter may be necessary if the response has a large number of errors.

Parameter Type Value
Mandatory
domain String

Name of the domain.

Optional
page Integer

Page number in the response. The default value is 1.

This parameter may be necessary if the response has multiple pages due to a large number of errors.

on_page Integer

Number of mailboxes with errors on each response page. The default value is 10.

This parameter may be necessary if the response has a large number of errors.

Request example

GET  /api2/admin/import/check_imports HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
...
domain=domain.com
cURL
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' 'https://pddimp.yandex.ru/api2/admin/import/check_imports?domain=domain.com'

Response structure

{
  "domain": "{domain name}",
  "settings":
    {
      "method": "{server protocol}",
      "server": "{server name}",
      "port": "{server port}",
      "ssl": "{use SSL}"
    },
  "import":
    {
      "state": "{state of import}",
      "total_box_count": "{number of mailboxes sent for import}",
      "done_box_count": "{number of successfully imported mailboxes}",
      "complete_box_count": "{number of mailboxes that were imported successfully and with errors}",
      "failed_boxes_count": "{number of mailboxes that did not finish importing due to errors}",
      "failed_boxes_pages": "{number of response pages with information about mailboxes that failed import due to errors}",
      "failed_boxes_current_page": "{page number in the response}",
      "imported_message_count": "{number of messages imported for all mailboxes}",
      "total_message_count": "{total number of messages sent for import}",
      "progress_percent": "{percent of import completed}",
      "failed_boxes":
        [
          {
            "external_login": "{username on the server source}",
            "external_password": "{password on the server source}",
            "internal_login": "{username on Yandex.Mail for Domain}",
            "internal_password": "{password on Yandex.Mail for Domain}",
            "imported_mail": "{number of messages imported}",
            "last_error": "{code of the last error}",
            "last_error_count": "{number of errors}",
          },
          ...
        ]
    },
  "success": "{status of request execution}"
}
Name Type of value Description
domain String

Name of the domain.

settings Object

Server source settings.

import Object

Information about the import.

success String

Status of request execution.

Possible values:
  • ok — Request executed successfully.
  • error — Request executed with error.
error String

Error code.

Included in the response if the request resulted in an error.

Possible values:
  • unknown — A temporary failure or API error occurred (repeat the request again later).
  • no_token (no_domain, no_ip ) — A mandatory parameter was omitted.
  • bad_domain — The domain name was not specified or does not conform to the RFC.
  • prohibited — A forbidden domain name.
  • bad_token (bad_login, bad_passwd) — An invalid PDD token (or username/password) was passed.
  • no_auth — The PddToken header was omitted.
  • not_allowed — This operation is not allowed for this user (the user is not the domain administrator).
  • blocked — Blocked domain (for example, due to spam and so on).
  • occupied — The domain name is in use by another user.
  • domain_limit_reached — Exceeded the acceptable number of connected domains (50).
  • no_reply — Yandex.Mail for Domain cannot connect to the server source for the import.
Keys for the settings object
method String

Server protocol.

Possible values:
  • imap

  • imap4

  • pop

  • pop3

server String

Server's domain name or IP address.

port Integer

Server port.

ssl String

Use of SSL.

Possible values:
  • yes — SSL connection required.
  • no — SSL should not be used.
Keys for the import object
state String

State of the import.

Possible values:
  • task_just_created — The import request was accepted, but the import has not been launched.
  • paused — The import has been paused in order to process other import requests (this occurs when processing a request with a large number of mailboxes).
  • in_progress — The import has been launched.
  • paused_cause_of_error — The import has been paused due to an error not related to the validity of the request (for example, the server rejected the connection).
  • failed — The import has been paused due to an error related to the validity of the import request (for example, an invalid username and password, and so on).
  • done — The import has finished successfully.
  • removed — The import was canceled by the user.
done_box_count Integer

The number of mailboxes that were imported successfully.

total_box_count Integer

The number of mailboxes that were sent for import.

complete_box_count Integer

The number of mailboxes that finished importing (either successfully, or with errors).

failed_boxes_count Integer The number of mailboxes that were not imported due to errors.
failed_boxes_pages Integer

The number of response pages with information about mailboxes that were not imported due to errors (the failed status).

failed_boxes_current_page Integer

Page number in the response.

imported_message_count Integer

The number of messages imported for all the domain's mailboxes (in the current session).

total_message_count Integer

The total number of messages for mailboxes that were sent for import.

progress_percent Integer

The import progress, as a percent.

failed_boxes Array

Data about mailboxes that were not imported, and their errors (the failed status). Each object in the array corresponds to a single mailbox.

Keys for objects in the failed_boxes 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.

imported_mail Integer The number of messages in a mailbox that were able to be imported.
last_error String

The error code that the last import attempt finished with.

last_error_count Integer

The number of errors that caused the import to fail.

Name Type of value Description
domain String

Name of the domain.

settings Object

Server source settings.

import Object

Information about the import.

success String

Status of request execution.

Possible values:
  • ok — Request executed successfully.
  • error — Request executed with error.
error String

Error code.

Included in the response if the request resulted in an error.

Possible values:
  • unknown — A temporary failure or API error occurred (repeat the request again later).
  • no_token (no_domain, no_ip ) — A mandatory parameter was omitted.
  • bad_domain — The domain name was not specified or does not conform to the RFC.
  • prohibited — A forbidden domain name.
  • bad_token (bad_login, bad_passwd) — An invalid PDD token (or username/password) was passed.
  • no_auth — The PddToken header was omitted.
  • not_allowed — This operation is not allowed for this user (the user is not the domain administrator).
  • blocked — Blocked domain (for example, due to spam and so on).
  • occupied — The domain name is in use by another user.
  • domain_limit_reached — Exceeded the acceptable number of connected domains (50).
  • no_reply — Yandex.Mail for Domain cannot connect to the server source for the import.
Keys for the settings object
method String

Server protocol.

Possible values:
  • imap

  • imap4

  • pop

  • pop3

server String

Server's domain name or IP address.

port Integer

Server port.

ssl String

Use of SSL.

Possible values:
  • yes — SSL connection required.
  • no — SSL should not be used.
Keys for the import object
state String

State of the import.

Possible values:
  • task_just_created — The import request was accepted, but the import has not been launched.
  • paused — The import has been paused in order to process other import requests (this occurs when processing a request with a large number of mailboxes).
  • in_progress — The import has been launched.
  • paused_cause_of_error — The import has been paused due to an error not related to the validity of the request (for example, the server rejected the connection).
  • failed — The import has been paused due to an error related to the validity of the import request (for example, an invalid username and password, and so on).
  • done — The import has finished successfully.
  • removed — The import was canceled by the user.
done_box_count Integer

The number of mailboxes that were imported successfully.

total_box_count Integer

The number of mailboxes that were sent for import.

complete_box_count Integer

The number of mailboxes that finished importing (either successfully, or with errors).

failed_boxes_count Integer The number of mailboxes that were not imported due to errors.
failed_boxes_pages Integer

The number of response pages with information about mailboxes that were not imported due to errors (the failed status).

failed_boxes_current_page Integer

Page number in the response.

imported_message_count Integer

The number of messages imported for all the domain's mailboxes (in the current session).

total_message_count Integer

The total number of messages for mailboxes that were sent for import.

progress_percent Integer

The import progress, as a percent.

failed_boxes Array

Data about mailboxes that were not imported, and their errors (the failed status). Each object in the array corresponds to a single mailbox.

Keys for objects in the failed_boxes 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.

imported_mail Integer The number of messages in a mailbox that were able to be imported.
last_error String

The error code that the last import attempt finished with.

last_error_count Integer

The number of errors that caused the import to fail.