API : Country List
Introduction
This request will return a list of countries
Request
| URL | https://api.telecomx.dk/tools/country |
| Method | GET |
| Access level | PERSONAL; VIEWER, MANAGER, OWNER, RESELLER, ADMIN. |
| Query | language | [optional] Determines the localisation of the country name. Allowed values are 'da' and 'en'. |
| offset | [optional] Index of the first destination to return, default 0. |
| limit | [optional] The number of destinations to return, default 100, min 1, max 500. |
Query examples
https://api.telecomx.dk/tools/country
https://api.telecomx.dk/tools/country?language=da
Response
| JSON object |
| offset | Index of the first destination returned. |
| limit | Number of destinations to return. Note that the actual number of destinations returned may be lower. |
| total | Number of destinations that can be returned when offset and limit is not considered. This is to be used for paging through the data. |
| countries | Array of destinations, see definition below. |
| Field | Type | Description |
| _id | String | ISO3166-2 2-char country code |
| prefix | String | Prefix for country, e.g. +45 for Denmark |
| image | ObjectID | ID of image from the Telecom X image server |
| names | Array | List of names, used for localisation. |
| names[].language | String | ISO 639-1 language code |
| names[].text | String | The localisation of the name. Only given if no language is given as query parameter |
| name | String | The country's name. Only given if a language is given as query parameter. |
Note that properties holding no value may be omitted from the object.
Response examples
Normal
{
offset: 100,
limit: 50,
total: 999,
countries:
[
{
_id: 'SE',
prefix: '+46',
image: ObjectID('1234567890ABCD1234567890'),
names: [
{
language: 'DA',
text: 'Danmark'
},
{
language: 'EN',
text: 'Denmark'
}
]
},
{
...
}
]
}
With language = da
{
offset: 100,
limit: 50,
total: 999,
countries:
[
{
_id: 'SE',
prefix: '+46',
image: ObjectID('1234567890ABCD1234567890'),
name: 'Danmark'
},
{
...
}
]
}
Errors
| Error code | Message | Description |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |