Countries-countryCode-provinces:GET

From Hostway API Documentation
Jump to: navigation, search

GET /countries/{countryCode}/provinces

Get list of provinces for a given country.

Contents


Request

GET /countries/{countryCode}/provinces

Request Parameters

countryCode - string
The 3166-1 alpha-2 country code (e.g. US, CA, UK, DE, AU).

URI Parameters

None.

Response

Status Code

200 OK
Success
404 Not Found
Returned if countryCode is not found or provinces are not defined for the given country.

Response Body

{
  "list": [
    {
      "code": "AL",
      "name": "Alabama"
    },
    {
      "code": "AK",
      "name": "Alaska"
    },	
...
...
    {
      "code": "WI",
      "name": "Wisconsin"
    },
    {
      "code": "WY",
      "name": "Wyoming"
    }
  ],
  "links": [
    "self": {"href": "https://api.hostway.com/countries/US/provinces", "rel": "self"}
  ]
}
 

Parameters

code - string
The state/province code (e.g. NJ, IL, DC, CA, FL).
name - string
The full state/province name.
links - list
Hypermedia for this resource. Links to self.

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox