Regions

GET /api/v1/regions

List of supported ISO-3166-1 country and ISO-3166-2 subdivision codes.

Query Parameters:
 
  • code – filter results by code
  • search – filter results by name and country name
Response JSON Array of Objects:
 
  • code (string) – ISO-3166 code of the country or subdivision
  • name (string) – localized name of the country or subdivision

Request:

GET /api/v1/regions HTTP/1.1
Host: account.emailicious.com
Accept: application/json

Response:

HTTP/1.1 200 OK
Vary: Accept
Allow: GET, HEAD, OPTIONS
Content-Type: application/json

{
    "count": 5140,
    "next": "/api/v1/regions?page=2",
    "previous": null,
    "results": [
        {
            "code": "AD",
            "name": "Andorra"
        },
        {
            "code": "AD-02",
            "name": "Canillo"
        },
        {
            "code": "AD-03",
            "name": "Encamp"
        },
        {
            "code": "AD-04",
            "name": "La Massana"
        },
        {
            "code": "AD-05",
            "name": "Ordino"
        }
    ]
}
GET /api/v1/regions/(string: code)

Details of the region matching the specified code.

Parameters:
  • code (string) – ISO-3166 country or subdivision code.
Response JSON Object:
 
  • code (string) – ISO-3166 code of the country or subdivision
  • name (string) – localized name of the country or subdivision
  • country (string) – ISO-3166-1 code of the subdivision’s country
  • regions (array) – ISO-3166-2 codes and localized names of the country’s subdivisions

Request:

GET /api/v1/regions/CA HTTP/1.1
Host: account.emailicious.com
Accept: application/json

Response:

HTTP/1.1 200 OK
Vary: Accept
Allow: GET, HEAD, OPTIONS
Content-Type: application/json

{
    "code": "CA",
    "name": "Canada",
    "country": null,
    "regions": [
        {
            "code": "CA-AB",
            "name": "Alberta"
        },
        {
            "code": "CA-BC",
            "name": "British Columbia"
        },
        {
            "code": "CA-MB",
            "name": "Manitoba"
        },
        {
            "code": "CA-NB",
            "name": "New Brunswick"
        },
        {
            "code": "CA-NL",
            "name": "Newfoundland and Labrador"
        },
        {
            "code": "CA-NS",
            "name": "Nova Scotia"
        },
        {
            "code": "CA-NT",
            "name": "Northwest Territories"
        },
        {
            "code": "CA-NU",
            "name": "Nunavut"
        },
        {
            "code": "CA-ON",
            "name": "Ontario"
        },
        {
            "code": "CA-PE",
            "name": "Prince Edward Island"
        },
        {
            "code": "CA-QC",
            "name": "Quebec"
        },
        {
            "code": "CA-SK",
            "name": "Saskatchewan"
        },
        {
            "code": "CA-YT",
            "name": "Yukon Territory"
        }
    ]
}