Countries:GET

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

GET /countries

Retrieves a list of all supported countries.

Contents


Request

GET /countries

Request Parameters

None.

URI Parameters

None.

Response

Returns a dictionary containing list of countries with 3166-1 alpha-2 country codes and a link to obtain the provinces for each country.

Status Code

200 OK
Success

Response Body

{
  "list": [
    {
      "code": "US",
      "name": "United States of America",
      "provinces": "https://api.hostway.com/countries/US/provinces"
    },
    {
      "code": "BG",
      "name": "Bulgaria",
      "provinces": "https://api.hostway.com/countries/BG/provinces"
    }
  ],
  "links": [
    {"rel": "self", "href": "https://api.hostway.com/countries"}
  ]
}
  

Parameters

list - list
List of countries with 3166-1 alpha-2 code and link to corresponding provinces list. Each element of the list has the following attributes:
code - string
The 3166-1 alpha-2 code of the country.
name - string
A descriptive name (in English) for the country.
provinces - URI
A URI to the list of provinces for the given country.
links - list
Hypermedia for this resource. Link to self will preserve filtering, sorting and pagination set by the request. Links to the first, last, previous and next pages will also be included if applicable.

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox