Get Started
Authentication
How to authenticate your API requests
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to authenticate your API requests
curl -X POST https://api.chessplay.io/api/token/ \
-H "Content-Type: application/json" \
-d '{
"username": "your_username",
"password": "your_password"
}'
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGc..."
}
curl -X GET https://api.chessplay.io/api/v1/students/ \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
# Login
response = requests.post('https://api.chessplay.io/api/token/', json={
'username': 'your_username',
'password': 'your_password'
})
token = response.json()['access']
# Use token
headers = {'Authorization': f'Bearer {token}'}
response = requests.get('https://api.chessplay.io/api/v1/students/', headers=headers)
// Login
const loginResponse = await fetch('https://api.chessplay.io/api/token/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: 'your_username',
password: 'your_password'
})
});
const { access } = await loginResponse.json();
// Use token
const response = await fetch('https://api.chessplay.io/api/v1/students/', {
headers: { 'Authorization': `Bearer ${access}` }
});
curl -X POST https://api.chessplay.io/api/token/refresh/ \
-H "Content-Type: application/json" \
-d '{"refresh": "YOUR_REFRESH_TOKEN"}'
{
"detail": "Authentication credentials were not provided."
}
{
"detail": "Token is expired"
}
Was this page helpful?
