Accounts-accountId-attributes-attribute:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Status Code)
 
m (1 revision: Release 109)
 

Latest revision as of 12:12, 24 July 2015

GET /accounts/{accountId}/attributes/{attribute}

Get attribute data.

Contents

Request

GET /accounts/{accountId}/attributes/{attribute}

Parameters

accountId - string
The Id of the account.

URI Parameters

attribute - string

Request Headers

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

Response

Status Code

200 OK
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.

Response Body

{ 
   "name": "{name}", 
   "value": {value},
   "links": [
      {
         "location": "{APIBaseURL}/accounts/{accountId}/attributes/{attribute}/", 
         "rel": "self"
      }
   ]
}
 

Parameters

name - string
Descriptive name of the attribute
value - string
Value of the attribute
links - list
Hypermedia for this resource. Links to self.


Examples

Sending unauthorized request

Request

GET /accounts/account-id/attributes/test_attribute
 

Response

401 Unauthorized
 

Sending request without setting Content-Type

Request

GET /accounts/account-id/attributes/test_attribute
Authorization: Basic base64_encode(username:password)
 

Response

415 Unsupported Media Type
 

Requesting not existing attribute

Request

GET /accounts/account-id/attributes/not_existing_attribute
Authorization: Basic base64_encode(username:password)
Content-Type: application/json
 

Response

404 Not Found
 

Success scenario

Request

GET /accounts/account-id/attributes/test_attribute
Authorization: Basic base64_encode(username:password)
Content-Type: application/json
 

Response

200 OK

{
   "name": "test_attribute", 
   "value": "123", 
   "links": [{"href": "{{APIBaseURL}}/accounts/account-id/attributes/test_attribute/", "rel": "related"}]
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox