Orders-orderId-account:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 98)
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 ===

Revision as of 04:38, 29 September 2014

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


Request

GET /orders/{orderId}/account

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
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.

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/",
}
 

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.


Example

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.

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" : ""
  }
}

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": ""
  }
}

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": ""
  }
}


See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox