Orders-orderId-attributes:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 90)
m (1 revision: Release 99)
 
(3 intermediate revisions by 2 users not shown)
Line 18: Line 18:
  
 
=== Status Code ===
 
=== Status Code ===
;200 OK
+
{| class='wikitable'
: The operation was successfully completed.
+
|-
 
+
! Status Code
;404 Not Found
+
! Error Message
: The order does not exist.
+
! Description
 +
|-
 +
| 200 OK
 +
| align="center" | -
 +
| Successfully retrieved order attributes.
 +
|-
 +
| 401 Unauthorized
 +
| align="center" | -
 +
| 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.
 +
|-
 +
| rowspan="2" | 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 ===
 
=== Response Body ===
Line 49: Line 73:
 
; links - ''list''
 
; links - ''list''
 
: [[Hypermedia]] for this resource.
 
: [[Hypermedia]] for this resource.
 +
 +
 +
== Example ==
 +
=== Successfully retrieve order attributes ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/000001485a3c75c8569447b3007f000000010001/attributes
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
200 OK
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "list" : [ {
 +
    "name" : "_utmb",
 +
    "value" : "utmb_val"
 +
  }, {
 +
    "name" : "_utma",
 +
    "value" : "utma_val"
 +
  } ],
 +
  "links" : [ {
 +
    "href" : "</nowiki>{{APIBaseURL}}<nowiki>/orders/000001485a3c75c8569447b3007f000000010001/attributes/",
 +
    "rel" : "self"
 +
  } ]
 +
}</nowiki>
 +
 +
=== Wrong authorization ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/attributes
 +
Cookie: OwnerId={wrong_owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
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.</nowiki>
 +
 +
=== Unassociated user without cookie===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/attributes
 +
Authorization: {unassociated_user_authorization}</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
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": ""
 +
  }
 +
}</nowiki>
 +
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{wrong_orderId}/attributes
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 +
=== No attributes set ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/attributes
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "ee20516d-011e-44ea-99d2-ae7a2b6fe99a",
 +
    "message": "MetaData is missing.",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
  
 
== See also ==
 
== See also ==

Latest revision as of 10:07, 14 October 2014

[edit] GET /orders/{orderId}/attributes

Get the list of attributes for an order.

Contents


[edit] Request

GET /orders/{orderId}/attributes

[edit] Request Parameters

orderId - string
The unique order Id. The URI of the order is returned by the POST /orders call.

[edit] URI Parameters

None.

[edit] 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.

[edit] Response

[edit] 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.

[edit] Response Body

{
 "list": [
  {
   "name": "{attributeName}",
   "value": "{attributeValue}"
  },
  ...
 ],
 "links": [
  {"href": "https://api.hostway.com/orders/{orderId}/attributes/", "rel": "self"}
 ]
}
 

[edit] Parameters

attributeName - string
The unique name of the attribute.
attributeValue - string
The value of the attribute.
links - list
Hypermedia for this resource.


[edit] Example

[edit] 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"
  } ]
}

[edit] 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.

[edit] 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": ""
  }
}

[edit] 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": ""
  }
}

[edit] 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": ""
  }
}


[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox