-
Notifications
You must be signed in to change notification settings - Fork 1
API Country
Elena edited this page Mar 31, 2021
·
5 revisions
Countries for UI panels in different languages for the TaskTracker plugin.
Field | Type | Description |
---|---|---|
key |
String | Country key. Must be unique. |
{lng_key} |
String | Country name in the language specified by the interface language key (en , ru , de , and others). For example, en stands for a country name in English. |
Field | Type | Description |
---|---|---|
key |
String | Country key. Must be unique. |
translation |
Array | Country names in different languages. See a response example below. |
Available languages:
- en - English
- ru - Russian
{
"key": "russia",
"translation":
[
{ "key":"en" },
"Russia",
{ "key":"ru" },
"Россия"
]
}
Endpoint | Method | Description |
---|---|---|
/api/country |
POST |
Create a new country in the database. |
Parameter | Type | Description |
---|---|---|
key |
String | Key of the country. Must be unique in the database. |
descriptions |
Array | Names of the country in different languages. |
{
"key": "russia",
"descriptions":
[
{
"language": "en",
"value": "Russia"
},
{
"language": "ru",
"value": "Россия"
}
]
}
Public fields of the country.
Endpoint | Method | Description |
---|---|---|
/api/country/all |
GET |
Get all countries. |
Empty body.
List of the countries. Each country has the public fields of the country model.
Endpoint | Method | Description |
---|---|---|
/api/country/:key |
GET |
Get a country by its key. |
Empty body.
Public fields of the country.
Endpoint | Method | Description |
---|---|---|
/api/country/:key |
DELETE |
Delete a country by its key. |
Empty body.
Public fields of the country.