States and Countries Search
This API retrieves the states or countries for a region. If no input is specified, the default is to retrieve all countries and states in North America. If the region is NA (North America), the state abbreviation and the full state name are returned, as well as the country abbreviation and the full country name. Outside of NA, only the country abbreviation and the full country name are returned.
GET /states
Resource URL
https://pcmiler.alk.com/apis/rest/v1.0/service.svc/states
Data Element | Description | Data Type | Value/Example |
---|---|---|---|
Region
| A string representing the region for which the list of states or countries to be retrieved. NA (North America) is default. |
Enum | NA (Default) AF (Africa) AS (Asia) EU (Europe) OC (Oceania) SA (South America) ME (Middle East) |
abbrFormat
| The abbreviation format for countries. |
Enum | Choices are FIPS, ISO2, ISO3, GENC2 and GENC3. The default is FIPS. |
countryOnly
| To specify if the search is for country only or for both country and states. |
boolean | The default is false, which retrieves both countries and states. |
Parameters
State Response
Data Element | Description | Data Type | Value/Example |
---|---|---|---|
StateAbbr
| State abbreviation which is 2 characters in length |
string | AL |
StateName
| The name of the state |
string | Alabama |
CountryAbbr
| Country abbreviation which is 2 characters in length |
string | US |
CountryName
| The name of the country |
string | United States |