Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the auth token to retrieve

Example Requests

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())

Status Codes

CodeDescription
200Auth token retrieved successfully
400Bad request — invalid parameters
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Not found — auth token does not exist
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the auth token
user_dataObjectInformation about the user associated with the token
keyStringThe regenerated authentication token key
created_atDateTimeTimestamp when the token was created
updated_atDateTimeTimestamp 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"
}