Retrieve Auth Token
Retrieve a specific auth token by its unique ID.
HTTP Request
GET/api/users/auth_tokens/: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 auth token to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.get('http://www.example.com/api/users/auth_tokens/123',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())1curl "http://www.example.com/api/users/auth_tokens/123" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Auth token retrieved successfully |
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — auth token does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the auth token |
| user_data | Object | Information about the user associated with the token |
| key | String | The regenerated authentication token key |
| created_at | DateTime | Timestamp when the token was created |
| updated_at | DateTime | Timestamp when the token was last updated (regenerated) |
Example Response
{
"id": 15,
"user_data": {
"id": 42,
"username": "johndoe",
"email": "johndoe@example.com"
},
"key": "newlygeneratedtokenkey1234567890abcdef",
"created_at": "2023-10-01T12:34:56Z",
"updated_at": "2024-06-15T09:21:00Z"
}