Countries:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
 

Latest revision as of 12:59, 20 February 2013

[edit] GET /countries

Retrieves a list of all supported countries.

Contents


[edit] Request

GET /countries

[edit] Request Parameters

None.

[edit] URI Parameters

None.

[edit] 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.

[edit] Status Code

200 OK
Success

[edit] 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"}
  ]
}
  

[edit] 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.

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox