Skip to the content
Documentation

REST API Countries list: comparison of v.1 vs v.2

No ratings yet

Versions Compared

Old Version 1

changes.mady.by.user Dominika Kurek

Saved on Apr 19, 2016

compared with

New Version Current

changes.mady.by.user Dominika Kurek

Saved on Apr 22, 2016

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Comment: layout change

Countries list is a REST service that gives access to an ISO-3166 formatted list of world countries. It is useful when presenting a country options list from any application.

Get the list of countries

To send a GET request to the REST API Countries list, you have to provide the Content Type header application/vnd.ez.api.CountriesList+xml.

...

Code Block
title Countries list request
Resource: /api/ezp/v2/services/countries
Method: GET
Content-Type: application/vnd.ez.api.CountriesList+xml

See the General REST usage documentation page for further information.

Usage example

 

Code Block
title Countries list request
GET /api/ezp/v2/services/countries
Host: example.com
Accept: application/vnd.ez.api.CountriesList+xml

 

The HTTP response will it be with a 200 OK Header.

Code Block
language bash
title Countries list response headers
HTTP/1.1 200
Content-Type: application/vnd.ez.api.CountriesList+xml

 

And the body of the Response is XML formatted country list with names and codes according to the ISO-3166 standard. 

Info
title ISO-3166
The country codes can be represented either as a two-letter code (alpha-2) which is recommended as the general purpose code, a three-letter code (alpha-3) which is more closely related to the country name and a three digit numeric code (numeric-3) which can be useful if you need to avoid using Latin script.

See the ISO-3166 glossary for more information.

 

Code Block
language xml
title Body XML Response
<CountriesList>
  <Country id="AF">
    <name>Afghanistan</name
    <alpha2>AF</alpha2>
    <alpha3>AFG</alpha3>
    <idc>93</idc>
  </Country>
  <Country id="AX">
    <name>Åland</name
    <alpha2>AX</alpha2>
    <alpha3>ALA</alpha3>
    <idc>358</idc>
  </Country>
  ...
</CountriesList>

 

 

In this topic:

Table of Contents
maxLevel 3

Comments

Add a comment

Comments are read by a moderator before they appear.