Request Authorization
Authorization header
To authorize each API request, you will need to transmit your API KEY in the Authorization header as follows:
Authorization: Token <API KEY>Example of request with a token
An example of using the Authorization header in an API request:
curl -X POST https://api.cryptocloud.plus/v1/invoice/create \
-header "Authorization: Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH"import requests
url = "https://api.cryptocloud.plus/v1/invoice/create"
headers = {
"Authorization": "Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH"
}
response = requests.post(url, headers=headers)
if response.status_code == 200:
print("Success:", response.json())
else:
print("Fail:", response.status_code, response.text)const url = 'https://api.cryptocloud.plus/v1/invoice/create';
const headers = new Headers({
'Authorization': 'Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH'
});
fetch(url, { method: 'POST', headers })
.then(response => {
if (response.ok) {
return response.json();
} else {
return Promise.reject('Authorization error');
}
})
.then(data => {
console.log('Success:', data);
})
.catch(error => {
console.error('Fail:', error);
});Possible errors
Response code
Error key
Error description
401
Unauthenticated
Incorrect API KEY
Example of response with an error
{
"message": "Unauthenticated."
}Last updated
Was this helpful?