pem.exchange.addMailboxWithTemplate

This method is supported by Operations starting from version 2.9

This method creates an Exchange Mailbox on the basis of a specified Mailbox Template.

There are the following use-cases of the method:

  • Create a Mailbox and assign the Mailbox to an existing Service User. In this case the user_id parameter should be specified. The new_user parameter should not be specified.
  • Create a Service User, create a Mailbox, and then assign the Mailbox to the created Service User. In this case the new_user parameter should be specified. The user_id parameter should not be specified.

The method has the following input parameters:

Name

Type

Short Description

[user_id]

int

ID of the existing Service User to which the Mailbox is assigned.

Notes:
1. The user_id and new_user optional parameters are mutually exclusive.
2. If the Service User has been bound to a Subscription containing services in the subscription-local mode (for example pem.addUser has been called and subscription_id has been specified), the system will use the subscription-local Hosted Exchange service from the same Subscription to create the Mailbox.
3. If the Service User has not been bound to any Subscription containing services in the subscription-local mode (for example pem.addUser has been called and owner_account_id has been specified), the system will use the account-wide Hosted Exchange service from an account Subscription containing services in the account-wide mode to create the Mailbox. In case when the account does not have the account-wide Hosted Exchange service, the method returns an error.
4. If the target account does not have the account-wide Hosted Exchange service and the target Service User is not bound to any Subscription and the Service User does not have services, use the pem.bindUserToSubscription method to bind the Service User to a Subscription containing the subscription-local Hosted Exchange service. After that it will be possible to create the Mailbox for the Service User using the subscription-local Hosted Exchange service.

[new_user]

struct

It defines properties of the new Service User.

Note: The user_id and new_user optional parameters are mutually exclusive.

  • subscription_id

int

ID of the Subscription.

Notes:
1. If the specified Subscription contains services in the subscription-local mode, the Service User will be bound to the Subscription and the subscription-local Hosted Exchange service from the specified Subscription will be used to create the Mailbox.
2. If the specified Subscription contains services in the account-wide mode, the account-wide Hosted Exchange service from the specified Subscription will be used to create the Mailbox.

  • login

string

Login of the Service User.

Note: If a Service User with the specified login already exists, Operations will try to assign the Mailbox to the existing Service User.

  • [password]

string

Password of the Service User. If the parameter is not specified, a password is generated by Operations.

  • [display_name]

string

Display Name of the Service User. If the parameter is not specified, the value of the login parameter is used as Display Name.

mailbox_template

string

The name of the Mailbox Template.

alias

string

It defines the alias of the Mailbox.

primary_email_address

string

It defines the primary e-mail address of the Mailbox. This address appears in the "From:" and "Reply-To:" fields of e-mail messages sent from the Mailbox.

[alt_email_addresses]

array of string

It defines the list of additional e-mail addresses of the Mailbox. These e-mail addresses should be based on domains, which belong to the Customer's Subscription.

[skip_initialization]

boolean

Whether to skip mailbox initialization (initialization means setting up the locale and creating the folders hierarchy for the Mailbox). If the parameter is omitted, the 0 value is used.

The method has the following output parameters:

Name

Type

Short Description

mailbox_id

int

Mailbox ID.

Notes:

1. This method can also be called under Reseller permissions.

2. Service User ID is not displayed in Operations control panel. You may use the pem.getUserByLogin or pem.getUsers methods to obtain the ID of the required Service User. Also, you may use the Operations Public API methods, which contain Service User ID(s) in the list of the output parameters.