Orders-orderId-account-contactInfo:GET
From Hostway API Documentation
(Difference between revisions)
(→Status Code) |
Mike.robski (Talk | contribs) m (1 revision: Release 99) |
Latest revision as of 09:06, 14 October 2014
GET /orders/{orderId}/account/contactInfo
Get all contact infos for an account in a given order.
Contents |
Request
GET /orders/{orderId}/account/contactInfo
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 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. |
Response Body
{ "contactInfo": { "regular": {...}, "billing": {...}, "administrator": {...}, "technical": {...} }, "links": [ {"href": "https://api.hostway.com/orders/{orderId}/account/contactInfo/", "rel": "self"} ] }
Parameters
- contactInfo - dictionary
- Details for all contact types specified for the account.
- links - list
- Hypermedia for this resource.
Example
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.
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" : "" } }
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": "" } }
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": "" } }
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": "" } }
See also