Subscribe to a mailing list

This request is used for adding a mailbox to a mailing list.

Both the mailing list and the subscriber can be specified using one of two properties: the email address, or the ID. You can find the mailing list ID in the response to the Get domain mailing lists request, and the subscriber ID in the response to the Get the list of mailboxes request.

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

Request syntax

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

POST /api2/admin/email/ml/subscribe
Host: pddimp.yandex.ru
PddToken: <PDD token>
...

domain=<domain name>
&(maillist=<email address or username of mailing list>|maillist_uid=<mailing list ID>)
&(subscriber=<email address of subscriber>|subscriber_uid=<subscriber ID>)
[&can_send_on_behalf=<subscriber status>]

Headers:

Name Description
PddToken

PDD token.

Name Description
PddToken

PDD token.

Parameters:

Parameter Type Value
Mandatory
domain String

Name of the domain.

maillist String

The email address of the mailing list, in the format “username@domain.ru” or “username”.

The request should only pass one of the parameters: maillist or maillist_uid.

maillist_uid Integer

ID of the mailing list.

You can get the ID value in the response to the Get domain mailing lists request.

The request should only pass one of the parameters: maillist or maillist_uid.

subscriber String

Subscriber's email address.

The request should only pass one of the parameters: subscriber or subscriber_uid.

subscriber_uid Integer

Subscriber's 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: subscriber or subscriber_uid.

Optional
can_send_on_behalf String
Subscriber's status. Possible values:
  • yes — The subscriber can send messages on behalf of the mailing list. Such a subscriber can specify the mailing list email address in the message from box (in the email interface).
  • no — The subscriber cannot send messages from the mailing list email address.
Parameter Type Value
Mandatory
domain String

Name of the domain.

maillist String

The email address of the mailing list, in the format “username@domain.ru” or “username”.

The request should only pass one of the parameters: maillist or maillist_uid.

maillist_uid Integer

ID of the mailing list.

You can get the ID value in the response to the Get domain mailing lists request.

The request should only pass one of the parameters: maillist or maillist_uid.

subscriber String

Subscriber's email address.

The request should only pass one of the parameters: subscriber or subscriber_uid.

subscriber_uid Integer

Subscriber's 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: subscriber or subscriber_uid.

Optional
can_send_on_behalf String
Subscriber's status. Possible values:
  • yes — The subscriber can send messages on behalf of the mailing list. Such a subscriber can specify the mailing list email address in the message from box (in the email interface).
  • no — The subscriber cannot send messages from the mailing list email address.

Request example

POST /api2/admin/email/ml/subscribe HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
...
domain=domain.com&maillist_uid=123456789&subscriber_uid=987654321&can_send_on_behalf=yes
cURL
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -d 'domain=domain.com&maillist_uid=123456789&subscriber_uid=987654321' 'https://pddimp.yandex.ru/api2/admin/email/ml/subscribe'

Response structure

{
  "domain": "{domain name}",
  "maillist": "{email address of the mailing list}",
  "uid": "{mailing list ID}",
  "subscriber": "{subscriber's email address}",
  "success": "{status of request execution}"
}
Name Type of value Description
domain String

Name of the domain.

maillist String

Email address of the mailing list.

uid Integer

ID of the mailing list.

subscriber String

Subscriber's email address.

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.
Name Type of value Description
domain String

Name of the domain.

maillist String

Email address of the mailing list.

uid Integer

ID of the mailing list.

subscriber String

Subscriber's email address.

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.