Bu API, belirli bir ülkenin şehirlerini listelemesini sağlar.
{{APP_URL}}/api/v1/countries/{country_id}/statesGETapplication/jsonAPIKEY| Parametre Adı | Parametre Tipi | Zorunluluk | Açıklama |
|---|---|---|---|
country_id |
Integer | Zorunlu | Ülke ID'si |
Aşağıda, API isteği için bir örnek HTTP raw request bulunmaktadır.
GET {{APP_URL}}/api/v1/countries/1/states
Content-Type: application/json
APIKEY: {{APIKEY}}
Başarılı bir istekte, API aşağıdaki gibi bir yanıt döndürecektir:
{
"status": true,
"message": null,
"data": [
{
"id": 1,
"name": "Badakhshan",
"stateCode": "BDS"
},
{
"id": 2,
"name": "Badghis",
"stateCode": "BDG"
},
{
"id": 3,
"name": "Baghlan",
"stateCode": "BGL"
},
{
"id": 4,
"name": "Balkh",
"stateCode": "BAL"
},
{
"id": 5,
"name": "Bamyan",
"stateCode": "BAM"
}
]
}
API isteği başarısız olursa, API aşağıdaki gibi bir hata yanıtı döndürecektir:
{
"status": false,
"errors": [
{
"message": "Country not found"
}
]
}