Check License Key Authorisation
Added in v1.0
POST
https://api.example.com/api/check
Requires authentication:
x-api-key: YOUR_API_KEY
The API returns a JSON response indicating whether the license is valid.
Headers
-
x-api-keystring required
Body parameters
-
idinteger requiredThe product ID the license key must belong to. -
infostring optionalText saved to the license log on a successful check.
Responses
- 200OK
- 400No License key
- 403IP Not Authorised
Request
curl -X POST 'https://api.example.com/api/check' \
-H 'x-api-key: X-API-KEY' \
-H 'Content-Type: application/json' \
-d '{
"id": 123,
"info": "My application v1.0.0"
}'
const response = await fetch('https://api.example.com/api/check', {
method: 'POST',
headers: {
'x-api-key': 'X-API-KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": 123,
"info": "My application v1.0.0"
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.example.com/api/check",
headers={
"x-api-key": "X-API-KEY",
"Content-Type": "application/json",
},
json={
"id": 123,
"info": "My application v1.0.0"
},
)
print(response.json())
<?php
$ch = curl_init('https://api.example.com/api/check');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-api-key: X-API-KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"id": 123,
"info": "My application v1.0.0"
}',
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Response
OK
{
"status": "AUTHORISED",
"pass": true,
"details": "Authorisation completed - example.com"
}
No License key
{
"status": "NOT FOUND",
"pass": false,
"details": "No key was provided"
}
IP Not Authorised
{
"status": "NOT AUTHORISED",
"pass": false,
"details": "The supplied IP is not authorised - example.com"
}