Retrieve City Details
Retrieves the details of a specific city by its unique id
HTTP Request
GET/api/locations/cities/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with CityPermission or Admin
- Permission Code: 1642
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique identifier of the city |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3url = "https://api.example.com/api/locations/cities/42"
4headers = {
5 "Authorization": "Token <your_api_key>"
6}
7response = requests.get(url, headers=headers)
8print(response.json())1curl -X GET "https://api.example.com/api/locations/cities/42" \
2-H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique city identifier |
| name | string | City name |
| state | integer | State id |
Sample Response
{
"id": 987,
"name": "گلوگاه",
"state": 27
}