Appearance
Список стран
Эндпоинт с помощью которого можно получить список стран.
Метод запроса: GET
bash
https://gateway.spark-dev.team/cabinet/api/v2/countries
Описание параметров запроса:
Наименование параметра | Тип | Обязательный параметр |
---|---|---|
page | Number | Нет |
limit | Number | Нет |
Пример запроса для получения первой страницы стран и ограничением в 20 элементов:
bash
https://gateway.spark-dev.team/cabinet/api/v2/countries?page=1&limit=20
Пример ответа
json
{
"data": [
{
"id": 1,
"title": "Казахстан"
}
],
"links": {
"first": "https://cabinetp.spark.kz/api/v2/countries?page=1",
"last": "https://cabinetp.spark.kz/api/v2/countries?page=38",
"prev": null,
"next": "https://cabinetp.spark.kz/api/v2/countries?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 38,
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=1",
"label": "1",
"active": true
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=2",
"label": "2",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=3",
"label": "3",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=4",
"label": "4",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=5",
"label": "5",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=6",
"label": "6",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=7",
"label": "7",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=8",
"label": "8",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=9",
"label": "9",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=37",
"label": "37",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=38",
"label": "38",
"active": false
},
{
"url": "https://cabinetp.spark.kz/api/v2/countries?page=2",
"label": "pagination.next",
"active": false
}
],
"path": "https://cabinetp.spark.kz/api/v2/countries",
"per_page": 1,
"to": 1,
"total": 38
},
"code": 0,
"success": true,
"message": "",
"errors": []
}