Documentation Index
Fetch the complete documentation index at: https://docs.qanapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Login, Logoff and be aware of your token
Login
const token = await client.auth.login(email, password);
Sample response:
{
"access_token": "YOUR_JWT_TOKEN",
"token_type": "bearer",
"expires_in": 3600 //1 hour default
}
Refresh Token
await client.auth.refreshToken({
headers: { Authorization: `Bearer ${token}` },
});
Sample response:
{
"access_token": "YOUR_JWT_TOKEN",
"token_type": "bearer",
"expires_in": 3600 //1 hour default
}
Get User Details
await client.auth.retrieveUserDetails({
headers: { Authorization: `Bearer ${token}` },
});
Sample response:
{
"id": 2,
"email": "user@qanapi.com",
"name": "User",
"first_login": 1,
"email_verified_at": true,
"gravatar_url": "https://www.gravatar.com...",
"roles": [ "admin" ]
}
User Logout
await client.auth.retrieveUserDetails({
headers: { Authorization: `Bearer ${token}` },
});
Sample response:
{
"user": "user@qanapi.com",
"message": "Successfully logged out"
}