Orders-orderId-attributes:GET

From Hostway API Documentation
Jump to: navigation, search

GET /orders/{orderId}/attributes

Get the list of attributes for an order.

Contents


Request

GET /orders/{orderId}/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 - Successfully retrieved order attributes.
401 Unauthorized - No owner Id specified or the specified owner is not authorized to retrieve order attributes.
403 Forbidden Unauthorized: Attributes failed permission check Access order attributes as an authenticated user, not associated with the order.
404 Not Found Resource not found Order does not exist.
MetaData is missing. Attributes have not been set.
502 Bad Gateway Unable to get attributes Unexpected (backend) error. Unable to retrieve order attributes.

Response Body

{
 "list": [
  {
   "name": "{attributeName}",
   "value": "{attributeValue}"
  },
  ...
 ],
 "links": [
  {"href": "https://api.hostway.com/orders/{orderId}/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

Successfully retrieve order attributes

Request

GET /orders/000001485a3c75c8569447b3007f000000010001/attributes
Cookie: OwnerId={owner_id}; Path=/

Response

200 OK
Content-Type : application/json; charset=UTF-8

{
  "list" : [ {
    "name" : "_utmb",
    "value" : "utmb_val"
  }, {
    "name" : "_utma",
    "value" : "utma_val"
  } ],
  "links" : [ {
    "href" : "https://api.hostway.com/orders/000001485a3c75c8569447b3007f000000010001/attributes/",
    "rel" : "self"
  } ]
}

Wrong authorization

Request

GET /orders/{orderId}/attributes
Cookie: OwnerId={wrong_owner_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}/attributes
Authorization: {unassociated_user_authorization}

Response

403 Forbidden
Content-Type: application/json; charset=UTF-8

{
  "forbidden": {
    "guid": "4d1e97e2-1497-48d5-b7a3-b3726656c4b5",
    "message": "Unauthorized: Attributes failed permission check",
    "code": 403,
    "details": ""
  }
}

Order does not exist

Request

GET /orders/{wrong_orderId}/attributes
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

No attributes set

Request

GET /orders/{orderId}/attributes
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
    "message": "MetaData is missing.",
    "code": 404,
    "details": ""
  }
}


See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox