Create License Key
Added in v1.0
POST
https://api.example.com/api/keys
Requires authentication:
X-API-Key: YOUR_API_KEY
Creates a license key with the desired information.
Body parameters
-
uidstring requiredExample:123 -
pidinteger requiredExample:123 -
ipstring optional -
statusboolean optional -
disabledboolean optional
Responses
- 200Success
- 201Created, but could not fetch the license.
- 400Missing uid or pid.
Request
curl -X POST 'https://api.example.com/api/keys' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"uid": "123",
"pid": 456,
"ip": "203.0.113.10",
"status": true,
"disabled": false
}'
const response = await fetch('https://api.example.com/api/keys', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"uid": "123",
"pid": 456,
"ip": "203.0.113.10",
"status": true,
"disabled": false
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.example.com/api/keys",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"uid": "123",
"pid": 456,
"ip": "203.0.113.10",
"status": True,
"disabled": False
},
)
print(response.json())
<?php
$ch = curl_init('https://api.example.com/api/keys');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"uid": "123",
"pid": 456,
"ip": "203.0.113.10",
"status": true,
"disabled": false
}',
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Response
Success
{
"id": 1,
"uuid": "123",
"product": 456,
"key": "0190a5f3-7c1e-7b2a-9d4e-3f8a6c1b2d90",
"ip": "203.0.113.10",
"status": true,
"disabled": false,
"locked": false,
"lastSeen": null
}
Created, but could not fetch the license.
{
"msg": "Created, but could not fetch the license."
}
Missing uid or pid.
{
"msg": "Missing uid or pid."
}