Email-domain-usernames-mailboxName-mailbox-action:POST

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 98)
m (1 revision: Release 101)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
= POST /email/{domain}/usernames/{mailboxName}/mailbox/action =
+
{{resetPassword|| a|resource=mailbox|base=|base_example=}}
Apply an action on a mailbox e.g. '''reset password'''
+
 
+
__TOC__
+
 
+
== Request ==
+
<code>POST /email/{domain}/usernames/{mailboxName}/mailbox/action</code>
+
 
+
==== Request Parameters ====
+
; domain - ''string''
+
: The specific domain for which the call will retrieve the list
+
; maiboxName - ''string''
+
: The name of the mailbox.
+
 
+
=== Request Headers ===
+
; Content-Type
+
: Required. Set this header to <code>application/json; charset=UTF-8</code>
+
 
+
=== Request Body ===
+
<nowiki>
+
{
+
  "action": "resetPassword",
+
  "actionData": {
+
    "secretQuestion": "{tk}",
+
    "secretAnswer": "{answer}",
+
    "password": "{password}"
+
  }
+
}
+
</nowiki>
+
 
+
; action - ''string''
+
: The action that should be performed. Allowed values are:
+
:: '''resetPassword''' - Reset the password of a mailbox.
+
 
+
; actionData - ''string (Required)''
+
: Data to be send with the action.
+
 
+
; tk - ''string'' (Required)
+
: The text key for the secret question. There should be no duplicate text keys per mailbox.
+
 
+
; answer - ''string'' (Required)
+
: The answer in plain-text - must be at least two characters.
+
{{:Accounts-account-email-domain-usernames-mailboxName-mailbox:PUT}}
+
 
+
== 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 a mailbox ===
+
'''Request'''
+
<nowiki>
+
POST /email/test.com/usernames/mailbox123/mailbox/action
+
Content-Type: application/json; Charset=UTF-8
+
 
+
{
+
  "action": "resetPassword",
+
  "actionData": {
+
    "secretQuestion": "tk1",
+
    "secretAnswer": "answer123",
+
    "password": "pWord123$"
+
}
+
</nowiki>
+
 
+
'''Response'''
+
<nowiki>
+
204 No Content
+
</nowiki>
+
 
+
=== Request password reset of a mailbox with wrong answer ===
+
'''Request'''
+
<nowiki>
+
POST /email/test.com/usernames/mailbox123/mailbox/action
+
Content-Type: application/json; Charset=UTF-8
+
 
+
{
+
  "action": "resetPassword",
+
  "actionData": {
+
    "secretQuestion": "tk1",
+
    "secretAnswer": "wrongAnswer",
+
    "password": "pWord123$"
+
}
+
</nowiki>
+
 
+
'''Response'''
+
<nowiki>
+
409 Conflict
+
 
+
{
+
  "conflict": {
+
    "message": "Verification failed",
+
    "code": 409,
+
  }
+
}
+
</nowiki>
+
== See also ==
+
* [[Email API|Email API]]
+
 
+
{{disqus}}
+
[[Category:Hostway API]]
+
[[Category:Email API]]
+

Latest revision as of 22:50, 16 December 2014

[edit] POST /email/{domain}/usernames/{mailboxName}/mailbox/action

Apply an action on a mailbox e.g. reset password

Contents


[edit] Request

POST /email/{domain}/usernames/{mailboxName}/mailbox/action

[edit] Request Parameters

account - string
The user account owning the domain and the mailboxes
domain - string
The specific domain for which the call will retrieve the list
maiboxName - string
The name of the mailbox.

[edit] Request Headers

Content-Type
Required. Set this header to application/json; charset=UTF-8

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


[edit] Response

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

[edit] Examples

[edit] Request password reset of a mailbox

Request

POST /email/test.com/usernames/mailbox123/mailbox/action
Content-Type: application/json; Charset=UTF-8

{ 
  "action": "resetPassword",
  "actionData": {
    "secretQuestionsAnswers": {"tk1": "answer123"},
    "password": "pWord123$"
}
 

Response

204 No Content
 

[edit] Request password reset of a mailbox with wrong answer

Request

POST /email/test.com/usernames/mailbox123/mailbox/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, 
  }
}
 

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox