Message-ID: <1003083856.3598.1485853808643.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3597_1699553571.1485853808643" ------=_Part_3597_1699553571.1485853808643 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html REST API Countries list

REST API Countries list

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

Get the list of count= ries

To send a GET request to the REST API Countries list, you have to provid= e the content-type header application/vnd.ez.api.CountriesList+xml.
Note= that cache request headers can be added but those aren't fully implemented= yet in eZ Publish 5.0.

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

See the General REST usage d= ocumentation page for further information.

Usage example

 

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

 

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

Countries list response headers
=20
HTTP/1.1 200=20
Content-Type: application/vnd.ez.api.CountriesList+xml
=20

 

And the body of the Response is XML formatted countrly list with name an= d codes according to the ISO-3166 standard. 

ISO-3166

The country codes can be represented either as a two-le= tter code (alpha-2) which is recommended as the general purpose code, a thr= ee-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=20 the ISO-3166 gloss= ary for more information.

 

Body XML Response
=20
<CountriesList>
  <Country id=3D"AF">
    <name>Afghanistan</name
    <alpha2>AF</alpha2>
    <alpha3>AFG</alpha3>
    <idc>93</idc>
  </Country>
  <Country id=3D"AX">
    <name>=C3=85land</name
    <alpha2>AX</alpha2>
    <alpha3>ALA</alpha3>
    <idc>358</idc>
  </Country>
  ...
</CountriesList>
=20

 

 

------=_Part_3597_1699553571.1485853808643--