Accounts-accountId-users:POST
From Hostway API Documentation
Revision as of 12:23, 31 January 2014 by Mike.robski (Talk | contribs)
POST /accounts/{accountId}/users
Create a new user under an account
Contents |
Request
POST /accounts/{accountId}/users
Request Parameters
- accountId
- The ID of the account
URI Parameters
None
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Request Body
{ "userName": "{userName}", "password": "{password}", "securityQuestion": "{securityQuestionCode}", "securityAnswer": "{securityAnswer}" }
Parameters
- userName
- Required. A name for the user that's about to be created. This needs to be unique within the entire security realm (not just within the account).
- password
- Required. A password for the user. This needs to be between 8 and 50 characters long inclusive, must contain at least one alpha and at least one numeric character, and must not contain any of the following characters: & ` ' " \ / < > $
- securityQuestionCode
- Required. The reference code for a question that the user can use to recover the password in case (s)he forgot it. This must be selected from a pre-approved list of questions.
- securityAnswer
- Required. An answer to the security question. If the user provides the correct answer during password recovery, the password will be reset and (s)he will be allowed to access the account. The API will automatically normalize the security answer by removing starting and ending spaces, lowercase the security answer and replace each sequence of whitespaces with just one single space character.
Response
Status Code
- 201 Created
- The user was successfully created
- 400 Bad Request
- The request body was missing a required field or one of the fields did not comply with the requirements (in this case, the response body will contain hints for what went wrong)
- 401 Unauthorized
- Authentication failed
- 403 Forbidden
- Authentication succeeded, but the logged-in user is not allowed to create users in this account. The only users allowed to create users in this account are sales agents and account owners of this account. An account owner is any account user with the "sitecontrol_account_owner" role.
- 404 Not Found
- The account does not exist
- 409 Conflict
- The user cannot be created because another user exists with the same username.
Response Headers
- Location
- The URI for the newly created user
Response Body
None
Allowed Security Questions
TBD
See also