Accounts-account-email-domain-usernames-mailboxName-webmail:PUT
From Hostway API Documentation
(Difference between revisions)
(→Parameters) |
Corinne.chui (Talk | contribs) m (1 revision) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 27: | Line 27: | ||
"type": "{oxtype}", | "type": "{oxtype}", | ||
"allowUpgrade": {allowUpgrade}, | "allowUpgrade": {allowUpgrade}, | ||
+ | "resetPassword": {resetPassword}, | ||
"theme": "{theme}", | "theme": "{theme}", | ||
"language": "{language}", | "language": "{language}", | ||
Line 36: | Line 37: | ||
==== Parameters ==== | ==== Parameters ==== | ||
; allowUpgrade - ''boolean'' | ; allowUpgrade - ''boolean'' | ||
− | : OpenXchange allowUpgrade option value | + | : OpenXchange allowUpgrade option value. If upgrades are disabled by the product, it cannot be set to true. |
− | ; type - ''string'' | + | ; type - ''string'' ''(Required)'' |
− | : OpenXchange account type. | + | : OpenXchange account type. Supported values can be obtained from the [[Accounts-account-email-domain-webmailNames:GET|webmailNames API endpoint]]. |
: The account owner(with admin-user credentials) can make changes between account types regardless of the allowUpgrade settings. | : The account owner(with admin-user credentials) can make changes between account types regardless of the allowUpgrade settings. | ||
: If the call is made with the end-user credentials and allowUpgrade is set to ''false'' providing a type different than standard results in a ''400 Bad Request'' response | : If the call is made with the end-user credentials and allowUpgrade is set to ''false'' providing a type different than standard results in a ''400 Bad Request'' response | ||
Line 44: | Line 45: | ||
: If current usage is more than new type quota the response is ''400 Bad Request'' | : If current usage is more than new type quota the response is ''400 Bad Request'' | ||
: If current mailbox qty is more than allowed for specific OpenXchange account type the response is ''400 Bad Request'' | : If current mailbox qty is more than allowed for specific OpenXchange account type the response is ''400 Bad Request'' | ||
+ | : If upgrades are disabled by the product, it can only be set to the current type | ||
+ | ; resetPassword - ''boolean'' | ||
+ | : Forces customer to reset his password the next time he logs in to his OX account. | ||
; theme - ''string'' | ; theme - ''string'' | ||
: Theme identifier for setting a specific theme when creating an OX account. | : Theme identifier for setting a specific theme when creating an OX account. | ||
Line 186: | Line 190: | ||
{"message": "Current mailbox usage is larger than the new quota value"} | {"message": "Current mailbox usage is larger than the new quota value"} | ||
</nowiki> | </nowiki> | ||
+ | === Success updating resetPassword flag === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | PUT /email/test.com/usernames/john.smith/webmail | ||
+ | |||
+ | {"resetPassword": true} | ||
+ | </nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 204 No Content | ||
+ | </nowiki> | ||
+ | |||
=== Success updating timezone, language and theme === | === Success updating timezone, language and theme === | ||
'''Request''' | '''Request''' |
Latest revision as of 14:36, 30 May 2016
[edit] PUT /accounts/{account}/email/{domain}/usernames/{mailboxName}/webmail
Upgrades/downgrades OpenXchange account type.
[edit] Request
PUT /accounts/{account}/email/{domain}/usernames/{mailboxName}/webmail
[edit] URI Parameters
- account - string
- domain - string
- mailboxName - string
[edit] 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
[edit] Request Body
{ "type": "{oxtype}", "allowUpgrade": {allowUpgrade}, "resetPassword": {resetPassword}, "theme": "{theme}", "language": "{language}", "timezone": "{timezone}" }
[edit] Parameters
- allowUpgrade - boolean
- OpenXchange allowUpgrade option value. If upgrades are disabled by the product, it cannot be set to true.
- type - string (Required)
- OpenXchange account type. Supported values can be obtained from the webmailNames API endpoint.
- The account owner(with admin-user credentials) can make changes between account types regardless of the allowUpgrade settings.
- If the call is made with the end-user credentials and allowUpgrade is set to false providing a type different than standard results in a 400 Bad Request response
- If the call is made with the end-user credentials and type is already different than standard and allowUpgrade is set to false the response is 400 Bad Request
- If current usage is more than new type quota the response is 400 Bad Request
- If current mailbox qty is more than allowed for specific OpenXchange account type the response is 400 Bad Request
- If upgrades are disabled by the product, it can only be set to the current type
- resetPassword - boolean
- Forces customer to reset his password the next time he logs in to his OX account.
- theme - string
- Theme identifier for setting a specific theme when creating an OX account.
- language - string
- OpenXchange account locale of type 'en_US'.
- timezone - string
- OpenXchange account timezone of type 'America/Chicago'.
[edit] Response
[edit] 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.
[edit] Examples
[edit] 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"}
[edit] 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"}
[edit] 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"}
[edit]
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."}
[edit] Failure upgrading 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"}
[edit] Failure upgrading account when mailbox qty for OX type is exceeded
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "activesync"}
Response
400 Bad Request {"computeFault":"Number of mailboxes exceeded"}
[edit] Success updating account type
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "premium"}
Response
204 No Content
[edit] Failure downgrading account due to current usage greater than new quota
Request
PUT /accounts/test/email/test.com/usernames/john.smith/webmail {"type": "standard"}
Response
400 Bad Request {"message": "Current mailbox usage is larger than the new quota value"}
[edit] Success updating resetPassword flag
Request
PUT /email/test.com/usernames/john.smith/webmail {"resetPassword": true}
Response
204 No Content
[edit] Success updating timezone, language and theme
Request
PUT /email/test.com/usernames/john.smith/webmail {"theme": "new_theme", "language": "en_US", "timezone": "America/Chicago"}
Response
204 No Content