Get current authentication token
GET
/api/user/token
const url = 'https://example.com/api/user/token';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/user/token \ --header 'Authorization: Bearer <token>'Retrieves the current user’s JWT authentication token from the session
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Token retrieved successfully
Media typeapplication/json
object
token
required
JWT authentication token
string
Examplegenerated
{ "token": "example"}Not authenticated
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}