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.
Body parameters
-
idstring required -
infostring optional
Responses
- 200OK
- 400No License key
- 403IP Not Authorised
Request
curl -X POST 'https://api.example.com/api/check' \
-H 'x-api-key: YOUR_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': 'YOUR_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": "YOUR_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: YOUR_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"
},
{
"status": "NOT FOUND",
"pass": false,
"details": "The supplied license key was not found. Please check your auth key is correct"
},
{
"status": "INVALID PRODUCT",
"pass": false,
"details": "The supplied product ID is not authorised for this license"
},
{
"status": "KEY DISABLED",
"pass": false,
"details": "This license key has been disabled by an administrator"
},
{
"status": "NOT ACTIVE",
"pass": false,
"details": "The supplied key is not active"
}
]
No License key
{
"status": "NO KEY",
"pass": false,
"details": "No license key was provided"
}
IP Not Authorised
{
"status": "NOT AUTHORISED",
"pass": false,
"details": "The supplied IP is not authorised - example.com"
}