Accounts-accountId-attributes:POST
From Hostway API Documentation
(Difference between revisions)
(→Status Code) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
Latest revision as of 12:12, 24 July 2015
POST /accounts/{accountId}/attributes
Get attributes list.
Contents |
Request
POST /accounts/{accountId}/attributes
Parameters
- accountId - string
- The Id of the Hostway account.
URI Parameters
None.
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
- Content-Type
- application/json
Request Body
{ "name": "test_attribute", "value": "value" }
Parameters
- name - string
- Descriptive name of the attribute
- value - dictionary
- Value of the attribute
Response
Status Code
- 201 Created
- Success.
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation.
- 403 Forbidden
- Forbidden access to a user not authorized for such access.
- 404 Not Found
- The account Id or attribute were not found.
- 415 Unsupported Media Type
- The Content-Type header was not specified or the specified type is not supported. Use application/json.
Examples
Sending unauthorized request
Request
POST /accounts/account-id/attributes {"name": "test_Account", "value": "test"}
Response
401 Unauthorized
Sending request without setting Content-Type
Request
POST /accounts/account-id/attributes Authorization: Basic base64_encode(username:password) {"name": "test_Account", "value": "test"}
Response
415 Unsupported Media Type
Failure creating attribute for not existing account
Request
POST /accounts/not-existing-account-id/attributes Authorization: Basic base64_encode(username:password) Content-Type: application/json {"name": "test_Account", "value": "test"}
Response
404 Not Found
Success scenario
Request
POST /accounts/account-id/attributes Authorization: Basic base64_encode(username:password) Content-Type: application/json {"name": "test_Account", "value": "test"}
Response
201 Created
See also