Accounts-account-email-domain-usernames-mailboxName-webmail:PUT
(Difference between revisions)
m (moved Accounts-account-email-domain-usernames-mailbox-webmail:PUT to Accounts-account-email-domain-usernames-mailboxName-webmail:PUT) |
Mike.robski (Talk | contribs) m (1 revision: Release 87) |
Revision as of 15:24, 15 November 2013
PUT /accounts/{account}/email/{domain}/usernames/{mailboxName}/webmail
Upgrades/downgrades OpenXchange account type.
Request
PUT /accounts/{account}/email/{domain}/usernames/{mailboxName}/webmail
URI Parameters
- account - string
- domain - string
- mailboxName - string
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
- Content-Type
- Required. Set this header to
application/json; charset=UTF-8
Request Body
{ "type": "{oxtype}", "allowUpgrade": {allowUpgrade} }
Parameters
- allowUpgrade - boolean
- OpenXchange allowUpgrade option value
- type - string - one of "standard", "activesync" or "premium"
- OpenXchange account type. Valid values are standard, activesync, premium. Required.
- If allowUpgrade is set to false providing a type different than standard results in a 400 Bad Request response
- If type is already different than standard and allowUpgrade is set to false the response is 400 Bad Request
Response
Status Code
- 204 No Content
- Success
- 400 Bad Request
- The format of the request body is invalid or the username does not meet the requirements.
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation.
- 404 Not Found
- The domain name does not exist.
Examples
Failure updating account type with missing required parameter
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": ""}
Response
400 Bad Request {"type": "Required"}
Failure updating account type with invalid parameter
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "invalid-type"}
Response
400 Bad Request {"type": "\"invalid-type\" is not one of standard, activesync, premium"}
Failure using inconsistent combination of allowUpgrade and type
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "premium", "allowUpgrade": false}
Response
400 Bad Request {"message": "The allowUpgrade option is inconsistent with the provided type"}
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"allowUpgrade": false}
Response
400 Bad Request {"message": "The account is already upgraded. Please downgrade it to standard first."}
Failure when upgrading the account while allowUpgrade is set to false
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "premium"}
Response
400 Bad Request {"message": "This account is not allowed to be upgraded"}
Success updating account type
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "premium"}
Response
204 No Content