Retrieve State Details
Retrieves the details of a specific state by its unique ID.
HTTP Request
GET/api/locations/states/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with StatePermission or Admin
- Permission Code: 1622
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the state |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.get('http://www.example.com/api/locations/states/1',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())1curl -X GET "http://www.example.com/api/locations/states/1" \
2-H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the state |
| name | String | Name of the state |
| code | String | ISO code of the state (e.g., "TE") |
| country | Integer | Id of the country |
Sample Response
{
"id": 20,
"name": "کردستان",
"code": "KU",
"country": 1
}