Orders-orderId-attributes:GET
From Hostway API Documentation
(Difference between revisions)
(Created page with "= GET /orders/''{orderId}''/attributes = Get the list of attributes for an order. __TOC__ == Request == <code>GET /orders/''{orderId}''/attributes</code> ==== Request Parame...") |
Mike.robski (Talk | contribs) m (1 revision: Release 99) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 18: | Line 18: | ||
=== Status Code === | === Status Code === | ||
− | + | {| class='wikitable' | |
− | : | + | |- |
− | + | ! Status Code | |
− | + | ! Error Message | |
− | + | ! 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 09:07, 14 October 2014
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