Countries-countryCode-provinces:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision)
 
(2 intermediate revisions by one user not shown)
Line 8: Line 8:
 
==== Request Parameters ====
 
==== Request Parameters ====
 
; countryCode - ''string''
 
; countryCode - ''string''
: The country code - ''e.g. US, CA, UK, DE, AU''
+
: The [http://www.iso.org/iso/iso-3166-1_decoding_table.html|ISO 3166-1 alpha-2] country code (e.g. ''US'', ''CA'', ''UK'', ''DE'', ''AU'').
  
 
=== URI Parameters ===
 
=== URI Parameters ===
Line 20: Line 20:
  
 
;404 Not Found
 
;404 Not Found
: Returned if countryCode is not found or provinces are not defined for the given country.
+
: Returned if ''countryCode'' is not found or provinces are not defined for the given country.
  
 
=== Response Body ===
 
=== Response Body ===
Line 27: Line 27:
 
   "list": [
 
   "list": [
 
     {
 
     {
       "isoCode": "AL",
+
       "code": "AL",
 
       "name": "Alabama"
 
       "name": "Alabama"
 
     },
 
     },
 
     {
 
     {
       "isoCode": "AK",
+
       "code": "AK",
 
       "name": "Alaska"
 
       "name": "Alaska"
 
     },
 
     },
Line 37: Line 37:
 
...
 
...
 
     {
 
     {
       "isoCode": "WI",
+
       "code": "WI",
 
       "name": "Wisconsin"
 
       "name": "Wisconsin"
 
     },
 
     },
 
     {
 
     {
       "isoCode": "WY",
+
       "code": "WY",
 
       "name": "Wyoming"
 
       "name": "Wyoming"
 
     }
 
     }
 
   ],
 
   ],
 
   "links": [
 
   "links": [
     "self": {"href": "</nowiki>{{APIBaseURL}}<nowiki>/countries/US/provinces/", "rel": "self"}
+
     "self": {"href": "</nowiki>{{APIBaseURL}}<nowiki>/countries/US/provinces", "rel": "self"}
 
   ]
 
   ]
 
}
 
}
Line 52: Line 52:
  
 
=== Parameters ===
 
=== Parameters ===
; isoCode - ''string''
+
; code - ''string''
: The state/province code - ''e.g. NJ, IL, DC, CA, FL''
+
: The state/province code (e.g. ''NJ'', ''IL'', ''DC'', ''CA'', ''FL'').
  
 
; name - ''string''
 
; name - ''string''
: Full state/province name
+
: The full state/province name.
  
 
; links - ''list''
 
; links - ''list''

Latest revision as of 11:59, 20 February 2013

[edit] GET /countries/{countryCode}/provinces

Get list of provinces for a given country.

Contents


[edit] Request

GET /countries/{countryCode}/provinces

[edit] Request Parameters

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

[edit] URI Parameters

None.

[edit] Response

[edit] Status Code

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

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

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

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox