Template:ResetPassword
From Hostway API Documentation
Revision as of 22:50, 16 December 2014 by Mike.robski (Talk | contribs)
POST {{{base}}}/email/{domain}/usernames/{mailboxName}/{{{resource}}}/action
Apply an action on{{{2}}}{{{1}}} mailbox e.g. reset password
Contents |
Request
POST {{{base}}}/email/{domain}/usernames/{mailboxName}/{{{resource}}}/action
Request Parameters
- account - string
- The user account owning the domain and the{{{1}}} mailboxes
- domain - string
- The specific domain for which the call will retrieve the list
- maiboxName - string
- The name of the{{{1}}} mailbox.
Request Headers
- Content-Type
- Required. Set this header to
application/json; charset=UTF-8
Request Body
{ "action": "resetPassword", "actionData": { "secretQuestionsAnswers": {"{tk}": "{answer}"}, "password": "{password}" } }
- action - string
- The action that should be performed. Allowed values are:
- resetPassword - Reset the password of{{{2}}}{{{1}}} mailbox.
- actionData - dictionary (Required)
- Data to be send with the action.
- secretQuestionsAnswers - dictionary (Required)
- Dictionary of key/value pairs, each of which represents secret question text key/answer pair.
- tk - string (Required)
- The text key for the secret question. There should be no duplicate text keys per{{{1}}} mailbox.
- answer - string (Required)
- The answer in plain-text - must be at least two characters.
- 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
Response
Expected Response Codes
- 204 No Content
- Success
- 400 Bad Request
- The supplied action or the supplied data is invalid.
- 404 Not Found
- The resource does not exist.
- 409 Conflict
- Validation of the secret answer failed.
Examples
Request password reset of{{{2}}}{{{1}}} mailbox
Request
POST {{{base_example}}}/email/test.com/usernames/mailbox123/{{{resource}}}/action Content-Type: application/json; Charset=UTF-8 { "action": "resetPassword", "actionData": { "secretQuestionsAnswers": {"tk1": "answer123"}, "password": "pWord123$" }
Response
204 No Content
Request password reset of{{{2}}}{{{1}}} mailbox with wrong answer
Request
POST {{{base_example}}}/email/test.com/usernames/mailbox123/{{{resource}}}/action Content-Type: application/json; Charset=UTF-8 { "action": "resetPassword", "actionData": { "secretQuestionsAnswersList": {"tk1": "wrongAnswer"}, "password": "pWord123$" }
Response
409 Conflict { "conflict": { "message": "Invalid secret questions and answers provided", "code": 409, } }
See also