Accounts-accountId-user:PUT

From Hostway API Documentation
Revision as of 09:28, 20 February 2013 by Mike.robski (Talk | contribs)
Jump to: navigation, search

PUT /accounts/{accountId}/user

Updates account user credentials.

Contents

Request

PUT /accounts/{accountId}/user

Parameters

accountId - string
The Id of the account.

URI Parameters

None.

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.
Content-Type
application/json

Request Body

{
  "userName": "{username}",
  "password": "{password}"
}
 

Parameters

userName - string
The account user name.
password - string
The new password. String that meets the password complexity requirements.

Response

Status Code

204 No Content
Success
400 Bad Request
The format of the request body is invalid or the password does not meet the complexity requirements.
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation.
404 Not Found
The account Id does not exist or the username did not match the username set for the account.
415 Unsupported Media Type
The Content-Type header was not specified or the specified type is not supported. Use application/json.

Examples

Request

PUT /accounts/test-account/user

{ "userName":"testuser", "password":"password12" }
 

Response

401 Unauthorized
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)

{ "userName":"testuser", "password":"password12" }
 

Response

415 Unsupported Media Type

{"badMediaType": {"message": "Unsupported media", "code": 415, "details": ""}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"notvalid-user", "password":"password12" }
 

Response

404 Not Found

{"itemNotFound": {"message": "Resource not found", "code": 404, "details": ""}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"testuser", "password":"" }
 

Response

400 Bad Request

{"badRequest": {"message": "POST data error", "code": 400, "details": {"password": "Required"}}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"testuser", "password":"pass" }
 

Response

400 Bad Request

{"computeFault": {"message": "The password should be at least 8 characters", "code": 400, "details": ""}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"testuser", "password":"pa$$word" }
 

Response

400 Bad Request

{"computeFault": {"message": "The password must contains digits and letters", "code": 400, "details": ""}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"testuser", "password":"password" }
 

Response

400 Bad Request

{"computeFault": {"message": "The password must contains at least one digit", "code": 400, "details": ""}}
 

Request

PUT /accounts/test-account/user
Authorization: Basic base64_encode(username:password)
Content-Type: application/json

{ "userName":"testuser", "password":"password12" }
 

Response

204 No Content
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox