Orders-orderId-account-attributes:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 98)
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 get attributes for this account.
 
| No owner Id specified or the specified owner is not authorized to get attributes for this account.
 +
|-
 +
| 403 Forbidden
 +
| Unauthorized: Attributes failed permission check
 +
| Access order account attributes as an authenticated user, not associated with the order.
 
|-
 
|-
 
| rowspan="2" | 404 Not Found
 
| rowspan="2" | 404 Not Found
Line 69: Line 73:
  
 
== Example ==
 
== Example ==
 +
 +
=== Get order information ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/attributes
 +
Cookie: OwnerId={ownerId}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
200 OK
 +
Content-Type: application/json; charset=UTF-8
 +
 +
{
 +
  "list" : [ {
 +
    "name" : "partner_account_id",
 +
    "value" : "paccid_050914054136"
 +
  } ],
 +
  "links" : [ {
 +
    "href" : "</nowiki>{{APIBaseURL}}<nowiki>/orders/{ownerId}/account/attributes/",
 +
    "rel" : "self"
 +
  } ]
 +
}</nowiki>
 +
 +
=== Get attributes with wrong OwnerId ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/attributes
 +
Cookie: OwnerId={wrong_order_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>
 +
 +
=== Unassociated user without cookie===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/attributes
 +
Authorization: {unassociated_user_authorization}</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
403 Forbidden
 +
Content-Type: application/json; charset=UTF-8
 +
 +
{
 +
  "forbidden" : {
 +
    "guid" : "66f63a81-52e9-4ec6-a50a-42acebc021e7",
 +
    "message" : "Unauthorized: Attributes failed permission check",
 +
    "code" : 403,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
 +
 
=== Get attributes of unset account ===
 
=== Get attributes of unset account ===
 
'''Request'''
 
'''Request'''

Latest revision as of 10:06, 14 October 2014

[edit] GET /orders/{orderId}/account/attributes

Get the list of attributes for an account in a given order.

Contents


[edit] Request

GET /orders/{orderId}/account/attributes

[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
200 OK - The operation was successfully completed.
401 Unauthorized - No owner Id specified or the specified owner is not authorized to get attributes for this account.
403 Forbidden Unauthorized: Attributes failed permission check Access order account attributes as an authenticated user, not associated with the order.
404 Not Found Resource not found The specified order does not exist.
MetaData is missing. Make sure the account is set before querying attributes. An account should be set before getting info for attributes.

[edit] Response Body

{
 "list": [
  {
   "name": "{attributeName}",
   "value": "{attributeValue}"
  },
  ...
 ],
 "links": [
  {"href": "https://api.hostway.com/orders/{orderId}/account/attributes/", "rel": "self"}
 ]
}
 

[edit] Parameters

attributeName - string
The unique name of the attribute.
attributeValue - string
The value of the attribute.
links - list
Hypermedia for this resource.


[edit] Example

[edit] Get order information

Request

GET /orders/{orderId}/account/attributes
Cookie: OwnerId={ownerId}; Path=/

Response

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

{
  "list" : [ {
    "name" : "partner_account_id",
    "value" : "paccid_050914054136"
  } ],
  "links" : [ {
    "href" : "https://api.hostway.com/orders/{ownerId}/account/attributes/",
    "rel" : "self"
  } ]
}

[edit] Get attributes with wrong OwnerId

Request

GET /orders/{orderId}/account/attributes
Cookie: OwnerId={wrong_order_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/attributes
Authorization: {unassociated_user_authorization}

Response

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

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

[edit] Get attributes of unset account

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "0068a205-0c4c-4105-9a14-dafe313bfc3a",
    "message": "MetaData is missing. Make sure the account is set before querying attributes.",
    "code": 404,
    "details": ""
  }
}

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox