Retrieve Contact
Retrieve a specific contact by its unique ID.
HTTP Request
GET/api/contacts/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the contact to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2response = requests.get('http://www.example.com/api/contacts/1', headers={
3 'Authorization': 'Token <your_api_key>'
4})
5
6print(response.json())1curl -X GET "http://www.example.com/api/contacts/1" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Contact retrieved successfully |
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — authentication required |
| 404 | Not found — contact does not exist |
| 403 | Forbidden — insufficient permissions |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the contact. |
| subject | String | The subject of the contact. |
| message | String | The message content of the contact. |
| first_name | String | The first name of the contact. |
| last_name | String | The last name of the contact. |
| String | The email address of the contact. | |
| mobile_number | String | Mobile number associated with the contact. |
| viewed | Boolean | Whether the contact has been viewed. |
| viewed_at | String (ISO 8601) | Timestamp when the contact was viewed. |
| created_at | String (ISO 8601) | Timestamp when the contact was created. |
| updated_at | String (ISO 8601) | Timestamp when the contact was last updated. |