Accounts-account-email-domain-usernames-mailboxName-mailbox:PUT
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 87 - update 2) |
(→Status Code) |
||
Line 25: | Line 25: | ||
{ | { | ||
"password": "{password}", | "password": "{password}", | ||
− | "master": {master} | + | "master": {master}, |
+ | "quota": {quota} | ||
} | } | ||
</nowiki> | </nowiki> | ||
Line 36: | Line 37: | ||
; master - ''boolean'' | ; master - ''boolean'' | ||
: Describes if this is a master account. | : Describes if this is a master account. | ||
+ | |||
+ | ; quota - ''int'' | ||
+ | : Quota value in MB. | ||
== Response == | == Response == | ||
Line 41: | Line 45: | ||
=== Status Code === | === Status Code === | ||
; 201 Created | ; 201 Created | ||
+ | : Success | ||
+ | |||
+ | ; 204 No Content | ||
: Success | : Success | ||
Line 67: | Line 74: | ||
{"password":"Required"} | {"password":"Required"} | ||
+ | </nowiki> | ||
+ | |||
+ | === Trying to create mailbox with invalid quota value(less or equal to 0) === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox | ||
+ | |||
+ | {"password: "test_password1", "quota": 0} | ||
+ | </nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 400 Bad Request | ||
+ | |||
+ | {"computeFault":"Quota must be greater than 0"} | ||
</nowiki> | </nowiki> | ||
Line 82: | Line 104: | ||
</nowiki> | </nowiki> | ||
+ | === Create mailbox with specified quota=== | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox | ||
+ | |||
+ | {"password": "pword1234", "quota": 70} | ||
+ | </nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 201 Created | ||
+ | </nowiki> | ||
+ | |||
+ | === Update existing mailbox quota=== | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox | ||
+ | |||
+ | {"quota": 85} | ||
+ | </nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 204 No Content | ||
+ | </nowiki> | ||
== See also == | == See also == |
Revision as of 11:28, 9 January 2014
PUT accounts/{account}/email/{domain}/usernames/{mailboxName}/mailbox
Creates or updates a mailbox for specified account and domain. The mailbox quota is determined by the E-mail domain product specification.
Contents |
Request
PUT accounts/{account}/email/{domain}/usernames/{mailboxName}/mailbox
URI Parameters
- account - string
- domain - string
- mailboxName - string
- The mailbox. String should meet the regexp [a-zA-Z0-9._-]+
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
{ "password": "{password}", "master": {master}, "quota": {quota} }
Parameters
- password - string
- The password. Required. The password should contain at least one letter and at least one digit. It should be at least 8 characters long. It should also not begin with "pass", and should not contain the second-level domain name of the service or the username of the mailbox.
- master - boolean
- Describes if this is a master account.
- quota - int
- Quota value in MB.
Response
Status Code
- 201 Created
- Success
- 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
Trying to create mailbox without a password
Request
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox {"master": false}
Response
400 Bad Request {"password":"Required"}
Trying to create mailbox with invalid quota value(less or equal to 0)
Request
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox {"password: "test_password1", "quota": 0}
Response
400 Bad Request {"computeFault":"Quota must be greater than 0"}
Create mailbox
Request
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox {"password": "pword1234", "master": true}
Response
201 Created
Create mailbox with specified quota
Request
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox {"password": "pword1234", "quota": 70}
Response
201 Created
Update existing mailbox quota
Request
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox {"quota": 85}
Response
204 No Content
See also