DELETE Exchange Mailbox
From Hostway API Documentation
(Difference between revisions)
(→URI Parameters) |
Mike.robski (Talk | contribs) m (1 revision: Release 103) |
Latest revision as of 11:24, 6 February 2015
DELETE /accounts/{accountNumber}/exchange/{domainName}/mailboxes/{useName}
Deletes an Exchange mailbox. The deletion process is asynchronous.
Contents |
Request
DELETE /accounts/{accountNumber}/exchange/{domainName}/mailboxes/{userName}?purge=purge-flag
Request Parameters
- accountNumber - string
- the account number of the mailbox owner
- domaiName - string
- the domain name of the mailbox
- userName - string
- the username of the mailbox
URI Parameters
- purge-flag - integer
- (OPTIONAL)
- a flag (with value 0 or 1) indicating whether or not to purge the mailbox, or only close without purging. If the deletion request is sent with purge=0, the mailbox can be restored without loss of data within 30 days after the close date. During this time, one may not create another mailbox with the same name. If the deletion request is sent with purge=1, all data will be purged and the mailbox cannot be re-opened. This parameter is optional; if omitted, the mailbox will be purged. Sales agent/admin credentials are required to delete the mailbox without purging.
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Request Body
None
Response
Status Code
- 202 - Accepted
- the deletion request has been accepted.
- 401 - Unauthorized
- the Authorization credentials are wrong or missing.
- 403 - Forbidden
- the user has been authorized. However, they are not allowed to access the resource. The only user(s) who has access to an Exchange mailbox must be a sales agent or the account owner, or the account technical admin. Additionally, this status may be raised when attempting to delete the mailbox with purge=0 without sales agent credentials.
- 404 - Not Found
- the mailbox does not exist.
- 409 - Conflict
- the deletion request was rejected due to conflict. Mailboxes with pending, close_pending, purge_pending status cannot be deleted.
Examples
Delete an existent open or closed mailbox
Request
DELETE http://<server_name>/accounts/<account_number>/exchange/<domain-name>/mailboxes/<existent-mailbox-username>?purge=1
Response
202 Accepted no-body
Delete an existent pending mailbox
Request
DELETE http://<server_name>/accounts/<account_number>/exchange/<domain-name>/mailboxes/<existent-mailbox-username>
Response
409 Conflict { "conflict" : { "guid" : "<generated_value>", "message" : "Cannot delete pending mailboxes", "code" : 409, "details" : "" } }