Orders-orderId-account-attributes:GET
From Hostway API Documentation
Revision as of 09:06, 14 October 2014 by Mike.robski (Talk | contribs)
GET /orders/{orderId}/account/attributes
Get the list of attributes for an account in a given order.
Contents |
Request
GET /orders/{orderId}/account/attributes
Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
URI Parameters
None.
Request Headers
- Cookie
- A cookie named OwnerId to identify the client (for most browser clients, the browser will do this automatically, depending on the browser configuration). The value of the cookie would come from the response to the create order request in the Set-Cookie response header.
Response
Status Code
Status Code | Error Message | Description |
---|---|---|
200 OK | - | The operation was successfully completed. |
401 Unauthorized | - | No owner Id specified or the specified owner is not authorized to get attributes for this account. |
403 Forbidden | Unauthorized: Attributes failed permission check | Access order account attributes as an authenticated user, not associated with the order. |
404 Not Found | Resource not found | The specified order does not exist. |
MetaData is missing. Make sure the account is set before querying attributes. | An account should be set before getting info for attributes. |
Response Body
{ "list": [ { "name": "{attributeName}", "value": "{attributeValue}" }, ... ], "links": [ {"href": "https://api.hostway.com/orders/{orderId}/account/attributes/", "rel": "self"} ] }
Parameters
- attributeName - string
- The unique name of the attribute.
- attributeValue - string
- The value of the attribute.
- links - list
- Hypermedia for this resource.
Example
Get order information
Request
GET /orders/{orderId}/account/attributes Cookie: OwnerId={ownerId}; Path=/
Response
200 OK Content-Type: application/json; charset=UTF-8 { "list" : [ { "name" : "partner_account_id", "value" : "paccid_050914054136" } ], "links" : [ { "href" : "https://api.hostway.com/orders/{ownerId}/account/attributes/", "rel" : "self" } ] }
Get attributes with wrong OwnerId
Request
GET /orders/{orderId}/account/attributes Cookie: OwnerId={wrong_order_id}; Path=/
Response
401 Unauthorized Content-Type: text/plain; charset=UTF-8 401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
Unassociated user without cookie
Request
GET /orders/{orderId}/account/attributes Authorization: {unassociated_user_authorization}
Response
403 Forbidden Content-Type: application/json; charset=UTF-8 { "forbidden" : { "guid" : "66f63a81-52e9-4ec6-a50a-42acebc021e7", "message" : "Unauthorized: Attributes failed permission check", "code" : 403, "details" : "" } }
Get attributes of unset account
Request
GET /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/
Response
404 Not Found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "0068a205-0c4c-4105-9a14-dafe313bfc3a", "message": "MetaData is missing. Make sure the account is set before querying attributes.", "code": 404, "details": "" } }
See also