Orders-orderId-account-user:GET

From Hostway API Documentation
Jump to: navigation, search

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.
401 Unauthorized - No owner Id specified or the specified owner is not authorized to set user credentials.
403 Forbidden Unauthorized: User failed permission check Retrieve user as an authenticated user, not associated with the order.
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"
  }]
}

No authorization

Request

GET /orders/{orderId}/account/user
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.

Unauthorized user

Request

GET /orders/{orderId}/account/user
Authorization: {unassociated_user_authorization}

Response

403 Forbidden
Content-Type: application/json; charset=UTF-8

{
  "forbidden" : {
    "guid" : "66f63a81-52e9-4ec6-a50a-42acebc021e7",
    "message" : "Unauthorized: User failed permission check",
    "code" : 403,
    "details" : ""
  }
}

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