Orders-orderId-account-contactInfo:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
m (1 revision: Release 99)
 
(3 intermediate revisions by 2 users not shown)
Line 18: Line 18:
  
 
=== Status Code ===
 
=== Status Code ===
;200 OK
+
{| class='wikitable'
: The operation was successfully completed.
+
|-
 
+
! Status Code
;404 Not Found
+
! Error Message
: An account has not been added to the given order or the order does not exist.
+
! Description
 +
|-
 +
| 200 OK
 +
| align="center" | -
 +
| The operation was successfully completed.
 +
|-
 +
| 401 Unauthorized
 +
| align="center" | -
 +
| No owner Id specified or the specified owner is not authorized to get contact info for this order.
 +
|-
 +
| 403 Forbidden
 +
| Unauthorized: ContactInfo failed permission check
 +
| Access account contact info as an authenticated user, not associated with the order.
 +
|-
 +
| rowspan="3" | 404 Not Found
 +
| rowspan="2" | Resource not found
 +
| The order does not have any contact info.
 +
|-
 +
| The specified order does not exist.
 +
|-
 +
| AccountNumber is missing. Make sure the account is set before querying.
 +
| An account was not set for the order.
 +
|-
 +
| 502 Bad Gateway
 +
| align="center" | -
 +
| Unexpected backend response. Cannot retrieve contact infos.
 +
|}
  
 
=== Response Body ===
 
=== Response Body ===
Line 45: Line 71:
 
; links - ''list''
 
; links - ''list''
 
: [[Hypermedia]] for this resource.
 
: [[Hypermedia]] for this resource.
 +
 +
== Example ==
 +
=== Get contact info with wrong OwnerId ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/contactInfo
 +
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/contactInfo
 +
Authorization: {unassociated_user_authorization}</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
403 Forbidden
 +
Content-Type: application/json; charset=UTF-8
 +
 +
{
 +
  "forbidden" : {
 +
    "guid" : "53fd5c41-a4b1-48d1-8196-43fc5ba32cf2",
 +
    "message" : "Unauthorized: ContactInfo failed permission check",
 +
    "code" : 403,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
 +
 +
=== Non-existent contact info for the order ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/contactInfo
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{non-existent_orderId}/account/contactInfo
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 +
=== Unset account for the order ===
 +
'''Request'''
 +
<nowiki>
 +
GET /orders/{orderId}/account/contactInfo
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 +
{
 +
  "itemNotFound": {
 +
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
 +
    "message": "AccountNumber is missing. Make sure the account is set before querying.",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Latest revision as of 10:06, 14 October 2014

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

Get all contact infos for an account in a given order.

Contents


[edit] Request

GET /orders/{orderId}/account/contactInfo

[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 contact info for this order.
403 Forbidden Unauthorized: ContactInfo failed permission check Access account contact info as an authenticated user, not associated with the order.
404 Not Found Resource not found The order does not have any contact info.
The specified order does not exist.
AccountNumber is missing. Make sure the account is set before querying. An account was not set for the order.
502 Bad Gateway - Unexpected backend response. Cannot retrieve contact infos.

[edit] Response Body

{
 "contactInfo": {
  "regular": {...},
  "billing": {...},
  "administrator": {...},
  "technical": {...}
 },
 "links": [
  {"href": "https://api.hostway.com/orders/{orderId}/account/contactInfo/", "rel": "self"}
 ]
}
 

[edit] Parameters

contactInfo - dictionary
Details for all contact types specified for the account.
links - list
Hypermedia for this resource.

[edit] Example

[edit] Get contact info with wrong OwnerId

Request

GET /orders/{orderId}/account/contactInfo
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/contactInfo
Authorization: {unassociated_user_authorization}

Response

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

{
  "forbidden" : {
    "guid" : "53fd5c41-a4b1-48d1-8196-43fc5ba32cf2",
    "message" : "Unauthorized: ContactInfo failed permission check",
    "code" : 403,
    "details" : ""
  }
}

[edit] Non-existent contact info for the order

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

[edit] Order does not exist

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

[edit] Unset account for the order

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
    "message": "AccountNumber is missing. Make sure the account is set before querying.",
    "code": 404,
    "details": ""
  }
}

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox