Orders-orderId-account:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
Line 18: Line 18:
  
 
=== Status Code ===
 
=== Status Code ===
;200 OK
 
: The operation was successfully completed.
 
  
;404 Not Found
+
{| class='wikitable'
: An account has not been added to the given order or the order does not exist.
+
|-
 +
! Status Code
 +
! Error Message
 +
! Description
 +
|-
 +
| 204 No Content
 +
| align="center" | -
 +
| The operation was successfully completed.
 +
|-
 +
| 401 Unauthorized
 +
| align="center" | -
 +
| No owner Id specified or the specified owner is not authorized to perform add account for this order.
 +
|-
 +
| rowspan="2" | 404 Not Found
 +
| rowspan="2" | Resource not found
 +
| An account has not been added to the given order.
 +
|-
 +
| The order does not exist.
 +
|}
  
 
=== Response Body ===
 
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
  "currency": "{currency}",
 
  "language": "{language}",
 
 
   "status": "{status}",
 
   "status": "{status}",
  "attributes": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/attributes/",
 
  "contactInfo": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/contactInfo/",
 
 
   "paymentInfo": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/paymentInfo/",
 
   "paymentInfo": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/paymentInfo/",
  "user": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/user/",
 
 
   "links": [
 
   "links": [
 
     {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/", "rel": "self"}
 
     {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/", "rel": "self"}
 
   ]
 
   ]
 +
  "language": "{language}",
 +
  "number": "{accountId}"
 +
  "currency": "{currency}",
 +
  "products": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/products/",
 +
  "user": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/user/",
 +
  "attributes": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/attributes/",
 +
  "contactInfo": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/contactInfo/",
 
}
 
}
 
  </nowiki>
 
  </nowiki>
Line 46: Line 64:
 
; language - ''string''
 
; language - ''string''
 
: An IETF[http://www.w3.org/International/articles/language-tags/Overview.en.php] language tag (ex. en, en-CA, en-US, etc.) specifying account's language.
 
: An IETF[http://www.w3.org/International/articles/language-tags/Overview.en.php] language tag (ex. en, en-CA, en-US, etc.) specifying account's language.
 +
 +
; number - ''string''
 +
: The account's Id.
  
 
; status - ''string''
 
; status - ''string''
Line 61: Line 82:
 
; user - ''string''
 
; user - ''string''
 
: A link to the account's [[Orders-orderId-account-user:GET|user]].
 
: A link to the account's [[Orders-orderId-account-user:GET|user]].
 +
 +
; products - ''string''
 +
: A link to the account's [[Orders-orderId-account-products:GET|products]].
  
 
; links - ''list''
 
; links - ''list''
 
: [[Hypermedia]] for this resource.
 
: [[Hypermedia]] for this resource.
 +
 +
 +
== Example ==
 +
=== Wrong authorization ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account
 +
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>
 +
 +
=== Account has not been set ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "9c2bf07d-4e74-4434-9d3e-77d57408d839",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{non-existent_orderId}/account
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "402282af-9f53-4973-8437-469087465843",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
  
 
== See also ==
 
== See also ==

Revision as of 06:50, 9 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.
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.

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