Orders-orderId-account:GET
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 98) |
Mike.robski (Talk | contribs) m (1 revision: Release 99) |
||
(One intermediate revision by one user not shown) | |||
Line 32: | Line 32: | ||
| align="center" | - | | align="center" | - | ||
| No owner Id specified or the specified owner is not authorized to perform add account for this order. | | No owner Id specified or the specified owner is not authorized to perform add account for this order. | ||
+ | |- | ||
+ | | 403 Forbidden | ||
+ | | Unauthorized: OrderAccount failed permission check | ||
+ | | Access order account as an authenticated user, not associated with the order. | ||
|- | |- | ||
| rowspan="2" | 404 Not Found | | rowspan="2" | 404 Not Found | ||
Line 107: | Line 111: | ||
Either you supplied the wrong credentials (e.g., bad password), | Either you supplied the wrong credentials (e.g., bad password), | ||
or your browser does not understand how to supply the credentials required.</nowiki> | or your browser does not understand how to supply the credentials required.</nowiki> | ||
+ | |||
+ | === Unassociated user without cookie=== | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account | ||
+ | Authorization: {unassociated_user_authorization}</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 403 Forbidden | ||
+ | Content-Type: application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "forbidden" : { | ||
+ | "guid" : "95646dcf-55cd-46cb-9bef-e1ef5d06f6c8", | ||
+ | "message" : "Unauthorized: OrderAccount failed permission check", | ||
+ | "code" : 403, | ||
+ | "details" : "" | ||
+ | } | ||
+ | }</nowiki> | ||
=== Account has not been set === | === Account has not been set === |
Latest revision as of 09:06, 14 October 2014
[edit] GET /orders/{orderId}/account
Get details of an Account in a given Order. It must be added to an order before details can be retrieved.
Contents |
[edit] Request
GET /orders/{orderId}/account
[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 |
---|---|---|
204 No Content | - | The operation was successfully completed. |
401 Unauthorized | - | No owner Id specified or the specified owner is not authorized to perform add account for this order. |
403 Forbidden | Unauthorized: OrderAccount failed permission check | Access order account as an authenticated user, not associated with the order. |
404 Not Found | Resource not found | An account has not been added to the given order. |
The order does not exist. |
[edit] Response Body
{ "status": "{status}", "paymentInfo": "https://api.hostway.com/orders/{orderId}/account/paymentInfo/", "links": [ {"href": "https://api.hostway.com/orders/{orderId}/account/", "rel": "self"} ] "language": "{language}", "number": "{accountId}" "currency": "{currency}", "products": "https://api.hostway.com/orders/{orderId}/account/products/", "user": "https://api.hostway.com/orders/{orderId}/account/user/", "attributes": "https://api.hostway.com/orders/{orderId}/account/attributes/", "contactInfo": "https://api.hostway.com/orders/{orderId}/account/contactInfo/", }
[edit] Parameters
- currency - string
- An ISO-4217[1] currency code assigned to the account.
- language - string
- An IETF[2] language tag (ex. en, en-CA, en-US, etc.) specifying account's language.
- number - string
- The account's Id.
- status - string
- The account's current status. Accounts that have not been provisioned will have a status of "new".
- attributes - string
- A link to the account's attributes.
- contactInfo - string
- A link to the account's contact info.
- paymentInfo - string
- A link to the account's payment information.
- user - string
- A link to the account's user.
- products - string
- A link to the account's products.
- links - list
- Hypermedia for this resource.
[edit] Example
[edit] Wrong authorization
Request
GET /orders/{orderId}/account 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}/account Authorization: {unassociated_user_authorization}
Response
403 Forbidden Content-Type: application/json; charset=UTF-8 { "forbidden" : { "guid" : "95646dcf-55cd-46cb-9bef-e1ef5d06f6c8", "message" : "Unauthorized: OrderAccount failed permission check", "code" : 403, "details" : "" } }
[edit] Account has not been set
Request
GET /orders/{orderId}/account Cookie: OwnerId={owner_id}; Path=/
Response
404 Not Found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "9c2bf07d-4e74-4434-9d3e-77d57408d839", "message": "Resource not found", "code": 404, "details": "" } }
[edit] Order does not exist
Request
GET /orders/{non-existent_orderId}/account Cookie: OwnerId={owner_id}; Path=/
Response
404 Not Found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "402282af-9f53-4973-8437-469087465843", "message": "Resource not found", "code": 404, "details": "" } }
[edit] See also