Orders-orderId-account-user:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Status Code)
Line 17: Line 17:
  
 
== Response ==
 
== Response ==
 
 
=== Status Code ===
 
=== Status Code ===
;200 OK
+
{| class='wikitable'
: The operation was successfully completed.
+
|-
 
+
! Status Code
;404 Not Found
+
! Error Message
: An account or user has not been added to the given order or the order does not exist.
+
! Description
 +
|-
 +
| 200 OK
 +
| align="center" | -
 +
| The operation was successfully completed.
 +
|-
 +
| rowspan="3" | 404 Not Found
 +
| rowspan="2" | Resource not found
 +
| The specified order does not exist.
 +
|-
 +
| An account was not set for the order.
 +
|-
 +
| align="center" | -
 +
| No user data found for the account.
 +
|-
 +
| 502 Bad Gateway
 +
| align="center" | -
 +
| Failed retrieving user data.
 +
|}
  
 
=== Response Body ===
 
=== Response Body ===
Line 41: Line 58:
 
; links - ''list''
 
; links - ''list''
 
: [[Hypermedia]] for this resource. Links to self.
 
: [[Hypermedia]] for this resource. Links to self.
 +
 +
== Example ==
 +
=== Success ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/user
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
200 OK
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "userName": "accountUser1",
 +
  "links": [{
 +
    "href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/0000014854c737a28b6dffbe007f000000010001/account/user/",
 +
    "rel": "self"
 +
  }]
 +
}</nowiki>
 +
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{non-existent_orderId}/account/user
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "b0b38b3e-b693-4021-8116-b59f7ec3fea7",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 +
=== Account has not been set ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/user
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "0c0c1f50-8d80-4423-b501-0a3cc5f070af",
 +
    "message": "",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Revision as of 03:37, 9 September 2014

GET /orders/{orderId}/account/user

Get details of the account user for the given order. A user with auto-generated information is created by default when the account is created. The user password is excluded from the response.

Contents


Request

GET /orders/{orderId}/account/user

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 - The operation was successfully completed.
404 Not Found Resource not found The specified order does not exist.
An account was not set for the order.
- No user data found for the account.
502 Bad Gateway - Failed retrieving user data.

Response Body

{
 "userName": "{userName}",
 "links": [
  {"href": "https://api.hostway.com/orders/{order_id}/account/user/", "rel": "self"}
 ]
}
 

Parameters

userName - string
The username of the account login credentials.
links - list
Hypermedia for this resource. Links to self.

Example

Success

Request

GET /orders/{orderId}/account/user
Cookie: OwnerId={owner_id}; Path=/

Response

200 OK
Content-Type : application/json; charset=UTF-8

{
  "userName": "accountUser1",
  "links": [{
    "href": "https://api.hostway.com/orders/0000014854c737a28b6dffbe007f000000010001/account/user/",
    "rel": "self"
  }]
}

Order does not exist

Request

GET /orders/{non-existent_orderId}/account/user
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "b0b38b3e-b693-4021-8116-b59f7ec3fea7",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Account has not been set

Request

GET /orders/{orderId}/account/user
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "0c0c1f50-8d80-4423-b501-0a3cc5f070af",
    "message": "",
    "code": 404,
    "details": ""
  }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox