Orders-orderId-account-contactInfo-contactType:GET

From Hostway API Documentation
Jump to: navigation, search

GET /orders/{orderId}/account/contactInfo/{contactType}

Get specific contact type details for an account in a given order.

Contents


Request

GET /orders/{orderId}/account/contactInfo/{contactType}

Request Parameters

orderId - string
The unique order Id. The URI of the order is returned by the POST /orders call.
contact_type - string
Contact Type (regular, billing, administrative or technical)

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 type 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 specified order does not exist.
An account was not set for the order.
The order does not have contact info of this type.
502 Bad Gateway - Unexpected backend response. Cannot retrieve contact info.

Response Body

{
 "contactInfo": {
  "name": {
   "salutation": "{salutation}",
   "firstName": "{firstname}",
   "middleName": "{middleName}",
   "lastName": "{lastName}",
   "company": "{company}"
  },
  "address": {
   "street1": "{street1}",
   "street2": "{street2}",
   "city": "{city}",
   "stateOrProvince": "{stateOrProvince}",
   "postalCode": "{postalCode}",
   "countryCode": "{countryCode}"
  },
  "contactMedia": {
   "phone1": "{phone1}",
   "phone2": "{phone2}",
   "fax": "{fax}",
   "email1": "{email1}",
   "email1Format": "{html|text}",
   "email2": "{email2}",
   "email2Format": "{html|text}"
  }
 },
 "links": [
  {"href": "https://api.hostway.com/orders/{orderId}/account/contactInfo/{contactType}/", "rel": "self"}]}
 ]
}
 

Parameters

salutation
Contact's salutation
firstName
Contact's first name.
middleName
Contact's middle name (optional).
lastName
Contact's last name.
company
Contact's company name (optional).
street1
Contact's street address.
street2
Contact's street address second line (optional).
city
Contact's city.
stateOrProvince
Contact's state or province.
postalCode
Contact's postal or ZIP code.
country
Contact's country code per ISO 3166-1 alpha-2[1].
phone1
Contact's primary phone number in ITU-T E.164[2] format.
phone2
Contact's secondary phone number in ITU-T E.164[3] format (optional).
fax
Contact's fax number in ITU-T E.164[4] format (optional).
email1
Contact's primary e-mail address.
email1Format
Primary e-mail delivery format: html or text.
email2
Contact's secondary e-mail address (optional).
email2Format
Secondary e-mail delivery format: html or text (optional).
links - list
Hypermedia for this resource.

Example

Get contact info with wrong OwnerId

Request

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

Get contact info of unset contact type

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Accout has not been set

Request

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

Response

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

{
  "itemNotFound": {
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Order does not exist

Request

GET /orders/{non-existent_orderId}/account/contactInfo/billing
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": ""
  }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox