Skip to main content

Retrieve Country Details

Retrieves the details of a specific country by its unique ID.

HTTP Request

GET/api/locations/countries/<id:int>

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with CountryPermission or Admin
  • Permission Code: 1602
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the country

Example Requests

1import requests
2
3response = requests.get('http://www.example.com/api/locations/countries/1', 
4  headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the country
nameStringName of the country
codeStringISO code of the country (e.g., "IR")

Sample Response

{
"id": 1,
"name": "ایران",
"code": "IR"
}