Countries:GET
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision) |
||
(One intermediate revision by one user not shown) | |||
Line 13: | Line 13: | ||
== Response == | == Response == | ||
− | Returns a dictionary containing list of countries with | + | Returns a dictionary containing list of countries with [http://www.iso.org/iso/iso-3166-1_decoding_table.html|ISO 3166-1 alpha-2] country codes and a link to obtain the provinces for each country. |
=== Status Code === | === Status Code === | ||
Line 24: | Line 24: | ||
"list": [ | "list": [ | ||
{ | { | ||
− | " | + | "code": "US", |
"name": "United States of America", | "name": "United States of America", | ||
− | "provinces": "</nowiki>{{APIBaseURL}}<nowiki>/countries/US/provinces | + | "provinces": "</nowiki>{{APIBaseURL}}<nowiki>/countries/US/provinces" |
}, | }, | ||
{ | { | ||
− | " | + | "code": "BG", |
"name": "Bulgaria", | "name": "Bulgaria", | ||
− | "provinces": "</nowiki>{{APIBaseURL}}<nowiki>/countries/BG/provinces | + | "provinces": "</nowiki>{{APIBaseURL}}<nowiki>/countries/BG/provinces" |
} | } | ||
], | ], | ||
Line 40: | Line 40: | ||
</nowiki> | </nowiki> | ||
+ | ==== Parameters ==== | ||
; list - ''list'' | ; list - ''list'' | ||
− | : List of countries with | + | : List of countries with [http://www.iso.org/iso/iso-3166-1_decoding_table.html|ISO 3166-1 alpha-2] code and link to corresponding provinces list. Each element of the list has the following attributes: |
− | :; | + | :; code - ''string'' |
− | :: The | + | :: The [http://www.iso.org/iso/iso-3166-1_decoding_table.html|ISO 3166-1 alpha-2] code of the country. |
:; name - ''string'' | :; name - ''string'' |
Latest revision as of 11:59, 20 February 2013
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