This API lists the cities belonging to a specific state.
| Property | Value |
|---|---|
| URL | {{APP_URL}}/api/v1/countries/{country_id}/states/{state_id}/cities |
| HTTP Method | GET |
| Content Type | application/json |
| Authentication | APIKEY header |
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
country_id |
Integer | Required | Country ID |
state_id |
Integer | Required | State ID |
Below is an example HTTP raw request for the API request.
GET {{APP_URL}}/api/v1/countries/1/states/1/cities
Content-Type: application/json
APIKEY: {{APIKEY}}
On a successful request, the API will return a response like the following:
{
"status": true,
"message": null,
"data": [
{
"id": 1,
"name": "Ashkāsham"
},
{
"id": 2,
"name": "Fayzabad"
},
{
"id": 3,
"name": "Jurm"
},
{
"id": 4,
"name": "Khandūd"
},
{
"id": 5,
"name": "Rāghistān"
},
{
"id": 6,
"name": "Wākhān"
}
]
}
If the API request fails, the API will return an error response like the following:
{
"status": false,
"errors": [
{
"message": "City not found"
}
]
}