Get the number of new messages
- the total number of unread messages in a mailbox.
- the number of messages the mailbox owner has received since last checking email.
The mailbox can be specified using the email address or the mailbox ID. You can get the ID in the response to the Get the list of mailboxes request.
Request syntax
The request should be sent over the HTTPS protocol using the GET method.
GET /api2/admin/email/counters?
domain=<domain name>
&(login=<email address or username for mailbox>|uid=<mailbox ID>)
Host: pddimp.yandex.ru
PddToken: <PDD token>
Headers:
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
login | String | The email address of the mailbox, in the format “username@domain.ru” or “username”. The request should only pass one of the parameters: |
uid | Integer | Mailbox ID. You can get the ID value in the response to the Get the list of mailboxes request. The request should only pass one of the parameters: |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
login | String | The email address of the mailbox, in the format “username@domain.ru” or “username”. The request should only pass one of the parameters: |
uid | Integer | Mailbox ID. You can get the ID value in the response to the Get the list of mailboxes request. The request should only pass one of the parameters: |
GET /api2/registrar/email/counters?
domain=<domain name>
&(login=<email address or username for mailbox>|uid=<mailbox ID>)
Host: pddimp.yandex.ru
PddToken: <PDD token>
Authorization: OAuth <OAuth token>
Headers:
Name | Description |
---|---|
PddToken | |
Authorization |
Name | Description |
---|---|
PddToken | |
Authorization |
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
login | String | The email address of the mailbox, in the format “username@domain.ru” or “username”. The request should only pass one of the parameters: |
uid | Integer | Mailbox ID. You can get the ID value in the response to the Get the list of mailboxes request. The request should only pass one of the parameters: |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
login | String | The email address of the mailbox, in the format “username@domain.ru” or “username”. The request should only pass one of the parameters: |
uid | Integer | Mailbox ID. You can get the ID value in the response to the Get the list of mailboxes request. The request should only pass one of the parameters: |
Request example
GET /api2/admin/email/counters?domain=domain.com&uid=12345678901 HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' 'https://pddimp.yandex.ru/api2/admin/email/counters?domain=domain.com&uid=12345678901'
GET /api2/admin/email/counters?domain=domain.com&uid=12345678901 HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -H 'Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000' 'https://pddimp.yandex.ru/api2/admin/email/counters?domain=domain.com&uid=12345678901'
Response structure
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
login | String | Email address of the mailbox. |
uid | Integer | Mailbox ID. |
counters | Object | The number of unread messages and messages received since last checking email. |
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 counters object | ||
unread | Integer | Total number of unread messages. |
new | Integer | The number of messages the mailbox owner has received since last checking email. |
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
login | String | Email address of the mailbox. |
uid | Integer | Mailbox ID. |
counters | Object | The number of unread messages and messages received since last checking email. |
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 counters object | ||
unread | Integer | Total number of unread messages. |
new | Integer | The number of messages the mailbox owner has received since last checking email. |