Zone

From Hostway API Documentation
Revision as of 07:09, 20 May 2013 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This operation will return all zones per account

GET /zones

Contents

Result

JSON

{
   "account_number":[
       {
           "zone": "zone_textkey",
           "location": "location_zone"
       },
       {
           "zone": "zone_textkey2",
           "location": "location_zone2"
       }
   ]
}

account_number - string
Account number for which are the zones. There can be several accounts per user.
zone - string
Zone textkey
location - string
Location of the zone

Response Codes

Success
HTTP/1.1 200 OK
Failure
HTTP/1.1 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.
HTTP/1.1 403 Forbidden - The resource is forbidden for this user

Examples

Successfully get the zones

GET http://{api_server}/zones

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

 {
   "smith1234":[
       {
           "zone": "USOTE-2012-TAMPA",
           "location": "ote.2012.tampa"
       }
   ]
 }

Failure while trying to make an unauthorized request

GET http://{api_server}/zones

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    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.

Permission denied failure

GET http(s)://{api_server}/zones

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 403 Forbidden

Response Body:

{
   "forbidden": 
      {
         "message": "forbidden", 
         "code": 403, 
         "details": "",
         "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
      }
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox