Countries:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
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 ISO 3166-1 alpha-2[http://www.iso.org/iso/iso-3166-1_decoding_table.html] country codes and a link to obtain the provinces of each country.
+
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": [
 
     {
 
     {
       "isoName": "US",
+
       "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"
 
     },
 
     },
 
     {
 
     {
       "isoName": "BG",
+
       "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 ISO 3166-1 alpha-2[http://www.iso.org/iso/iso-3166-1_decoding_table.html] code and link to corresponding province list. Each element of the list has the following attributes:
+
: 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:
  
:; isoName - ''string''
+
:; code - ''string''
:: The ISO 3166-1 alpha-2[http://www.iso.org/iso/iso-3166-1_decoding_table.html] code of the country.
+
:: 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


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox