Accounts-account-email-domain-usernames-mailboxName-mailbox:PUT

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision)
 
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
= PUT accounts/{account}/email/{domain}/usernames/{mailboxName}/mailbox =
 
= PUT accounts/{account}/email/{domain}/usernames/{mailboxName}/mailbox =
Creates a mailbox for specified account and domain
+
Creates or updates a mailbox for specified account and domain. The mailbox quota is determined by the E-mail domain product specification.
 
__TOC__
 
__TOC__
  
Line 25: Line 25:
 
{
 
{
 
     "password": "{password}",  
 
     "password": "{password}",  
     "master": {master}
+
     "master": {master},
 +
    "quota": {quota},
 +
    "type": {type},
 +
    "username": {username}
 
}
 
}
 
  </nowiki>
 
  </nowiki>
Line 31: Line 34:
  
 
==== Parameters ====
 
==== Parameters ====
; password - ''string''
+
<onlyinclude>
: 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.
+
; password - ''string'' (Required)
 +
: The password. The password should be at least 8 characters long, a mix of numbers, symbols and mixed-case letters. It should not begin with "pass", "123", "abc", should not contain the second-level domain name of the service, should not contain the username of the mailbox or start with its first 3 characters. There is a restriction using the same password more than once.
 +
: Password validation rules:
 +
:: Password must not be used more than once
 +
:: Minimum length 8
 +
:: Maximum length 128
 +
:: Should have at least one digit
 +
:: Should have at least one capital letter
 +
:: Should have at least one lower case letter
 +
:: Should contain at least one special character (any character other than lower or uppercase letters, digits and underscore "_" is considered special character)
 +
:: Should not start with the phrase 'pass' case-insensitively
 +
:: Should not start with 'abc' case-insensitively
 +
:: Should not start with 123
 +
:: Must not contain second-level domain, username or start with the first 3 letters from the username
 +
</onlyinclude>
  
 
; master - ''boolean''
 
; master - ''boolean''
 
: Describes if this is a master account.
 
: Describes if this is a master account.
 +
 +
; quota - ''int''
 +
: Quota value in MB. If not provided default quota for OpenXchange type is set
 +
 +
; type - ''string''
 +
: OpenXchange account type. Supported values can be obtained from the [[Accounts-account-email-domain-webmailNames:GET|webmailNames API endpoint]]. If not provided - standard is default.
 +
: If current mailbox qty is more than the allowed value for specific OpenXchange account type, the response will be ''400 Bad Request''
 +
 +
; username - ''string''
 +
: The mailbox. String should meet the regexp [a-zA-Z0-9._-]+
 +
: Should be used when updating mailbox only
  
 
== Response ==
 
== Response ==
Line 41: Line 69:
 
=== Status Code ===
 
=== Status Code ===
 
; 201 Created
 
; 201 Created
 +
: Success
 +
 +
; 204 No Content
 
: Success
 
: Success
  
Line 51: Line 82:
 
; 404 Not Found
 
; 404 Not Found
 
: The domain name does not exist.
 
: The domain name does not exist.
 +
 +
; 409 Conflict
 +
: Mailbox already exists.
  
 
== Examples ==
 
== Examples ==
Line 57: Line 91:
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox
+
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
  
 
{"master": false}
 
{"master": false}
Line 67: Line 101:
  
 
{"password":"Required"}
 
{"password":"Required"}
 +
</nowiki>
 +
 +
=== Trying to create mailbox with a not valid password ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
 +
 +
{"password": "abc1234", "master": true}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
400 Bad Request
 +
 +
{"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>
 +
 +
=== Trying to create mailbox when mailbox qty for OX type is exceeded ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
 +
 +
{"password: "test_password1", "type": "activesync"}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
400 Bad Request
 +
 +
{"computeFault":"Number of mailboxes exceeded"}
 
  </nowiki>
 
  </nowiki>
  
Line 72: Line 151:
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
PUT accounts/test-account123/email/test.com/usernames/john.smith/mailbox
+
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
  
{"password": "pword1234", "master": true}
+
{"password": "pWord123$", "master": true}
 
  </nowiki>
 
  </nowiki>
  
Line 82: Line 161:
 
  </nowiki>
 
  </nowiki>
  
 +
=== Update mailbox password ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
 +
 +
{"password": "!q2w3e4R"}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
204 No Content
 +
</nowiki>
 +
 +
=== Trying to update mailbox password with already used one ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith2/mailbox
 +
 +
{"password": "pWord123$"}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
400 Bad Request
 +
</nowiki>
 +
 +
 +
=== Update mailbox name ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
 +
 +
{"username": "john.smith2"}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
204 No Content
 +
</nowiki>
 +
 +
 +
=== Update mailbox using an existing name ===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox
 +
 +
{"username": "jack.smith"}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
400 Bad Request
 +
</nowiki>
 +
 +
=== Create mailbox with specified quota===
 +
'''Request'''
 +
<nowiki>
 +
PUT /accounts/test-account123/email/test.com/usernames/john.smith2/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.smith2/mailbox
 +
 +
{"quota": 85}
 +
</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
204 No Content
 +
</nowiki>
  
 
== See also ==
 
== See also ==
* [[Email Service API|Email Service API]]
+
* [[Email API|Email API]]
  
 
{{disqus}}
 
{{disqus}}
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:Email API]]
 
[[Category:Email API]]

Latest revision as of 13:36, 30 May 2016

[edit] 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


[edit] Request

PUT accounts/{account}/email/{domain}/usernames/{mailboxName}/mailbox

[edit] URI Parameters

account - string
domain - string
mailboxName - string
The mailbox. String should meet the regexp [a-zA-Z0-9._-]+

[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

{
    "password": "{password}", 
    "master": {master},
    "quota": {quota},
    "type": {type},
    "username": {username}
}
 


[edit] Parameters

password - string (Required)
The password. The password should be at least 8 characters long, a mix of numbers, symbols and mixed-case letters. It should not begin with "pass", "123", "abc", should not contain the second-level domain name of the service, should not contain the username of the mailbox or start with its first 3 characters. There is a restriction using the same password more than once.
Password validation rules:
Password must not be used more than once
Minimum length 8
Maximum length 128
Should have at least one digit
Should have at least one capital letter
Should have at least one lower case letter
Should contain at least one special character (any character other than lower or uppercase letters, digits and underscore "_" is considered special character)
Should not start with the phrase 'pass' case-insensitively
Should not start with 'abc' case-insensitively
Should not start with 123
Must not contain second-level domain, username or start with the first 3 letters from the username


master - boolean
Describes if this is a master account.
quota - int
Quota value in MB. If not provided default quota for OpenXchange type is set
type - string
OpenXchange account type. Supported values can be obtained from the webmailNames API endpoint. If not provided - standard is default.
If current mailbox qty is more than the allowed value for specific OpenXchange account type, the response will be 400 Bad Request
username - string
The mailbox. String should meet the regexp [a-zA-Z0-9._-]+
Should be used when updating mailbox only

[edit] Response

[edit] 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.
409 Conflict
Mailbox already exists.

[edit] Examples

[edit] 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"}
 

[edit] Trying to create mailbox with a not valid password

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"password": "abc1234", "master": true}
 

Response

400 Bad Request

{"password":"Required"}
 

[edit] 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"}
 

[edit] Trying to create mailbox when mailbox qty for OX type is exceeded

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"password: "test_password1", "type": "activesync"}
 

Response

400 Bad Request

{"computeFault":"Number of mailboxes exceeded"}
 

[edit] Create mailbox

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"password": "pWord123$", "master": true}
 

Response

201 Created
 

[edit] Update mailbox password

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"password": "!q2w3e4R"}
 

Response

204 No Content
 

[edit] Trying to update mailbox password with already used one

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith2/mailbox

{"password": "pWord123$"}
 

Response

400 Bad Request
 


[edit] Update mailbox name

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"username": "john.smith2"}
 

Response

204 No Content
 


[edit] Update mailbox using an existing name

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith/mailbox

{"username": "jack.smith"}
 

Response

400 Bad Request
 

[edit] Create mailbox with specified quota

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith2/mailbox

{"password": "pword1234", "quota": 70}
 

Response

201 Created
 

[edit] Update existing mailbox quota

Request

PUT /accounts/test-account123/email/test.com/usernames/john.smith2/mailbox

{"quota": 85}
 

Response

204 No Content
 

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox