Authentication
Should I be authenticated to use the REST API? Which endpoints require authentication? How to authenticate?
JSON Web Tokens
npm i -g @akord/akord-cliakord login <akord_account_email> -p <akord_account_password> -tconst { spawn } = require('child_process');
const command = 'akord';
const args = ['login', email, '-p', password, '-t'];
const process = spawn(command, args);
process.stdout.on('data', (data) => {
console.log('JWT:', data.toString());
});
process.stderr.on('data', (data) => {
console.error('Error:', data.toString());
});import subprocess
command = ['akord', 'login', email, '-p', password, '-t']
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
print("JWT:", stdout.decode())
print("Error:", stderr.decode())curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_token"
https://api.akord.com/storage-balanceconst response = await fetch('https://api.akord.com/storage-balance', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your_jwt',
'Content-Type': 'application/plain'
}
})import requests
response = requests.get(
url='https://api.akord.com/storage-balance',
headers={
'Accept': 'application/json',
'Authorization': 'Bearer your_jwt',
'Content-Type': 'applicaiton/json'
}
)API Key
Last updated