API Documentation
Overview
The RC Licensing System provides a comprehensive REST API for license management, verification, and integration with third-party applications.
API Base URL
https://api.licensetube.com/api/v1
Authentication
API Key Authentication
All API requests require authentication using an API key:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.licensetube.com/api/v1/license/status
Getting Your API Key
Your API key is available in your account dashboard. Keep it secure and never share it publicly.
API Endpoints
License Status
GET /license/status
Retrieve current license status
Request:
GET https://api.licensetube.com/api/v1/license/status
Authorization: Bearer YOUR_API_KEY
Response:
{
"status": "active",
"type": "cPanel",
"expires": "2025-12-31",
"cores": 4,
"workers": 4,
"ip": "192.168.1.1",
"hostname": "server.example.com"
}
License Verification
POST /license/verify
Verify a license key
Request:
POST https://api.licensetube.com/api/v1/license/verify
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"license_key": "YOUR_LICENSE_KEY",
"ip_address": "192.168.1.1"
}
Response:
{
"valid": true,
"type": "cPanel",
"expires": "2025-12-31",
"message": "License is valid"
}
License Update
POST /license/update
Update license information
Request:
POST https://api.licensetube.com/api/v1/license/update
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"license_key": "YOUR_LICENSE_KEY",
"hostname": "server.example.com",
"ip_address": "192.168.1.1"
}
Response:
{
"success": true,
"message": "License updated successfully",
"updated_at": "2025-01-18T12:00:00Z"
}
License List
GET /licenses
List all licenses for your account
Request:
GET https://api.licensetube.com/api/v1/licenses
Authorization: Bearer YOUR_API_KEY
Response:
{
"licenses": [
{
"id": "lic_123",
"type": "cPanel",
"status": "active",
"expires": "2025-12-31",
"server": "server1.example.com"
},
{
"id": "lic_124",
"type": "LiteSpeed",
"status": "active",
"expires": "2025-06-30",
"server": "server2.example.com"
}
]
}
Diagnostics
GET /diagnostics
Get system diagnostics
Request:
GET https://api.licensetube.com/api/v1/diagnostics
Authorization: Bearer YOUR_API_KEY
Response:
{
"os": "CentOS 7.9",
"kernel": "3.10.0-1160.49.1.el7.x86_64",
"cpu_cores": 4,
"memory": "8GB",
"disk_free": "100GB",
"uptime": "45 days"
}
Error Handling
Error Response Format
{
"error": true,
"code": "INVALID_LICENSE",
"message": "The provided license key is invalid",
"details": {
"license_key": "Invalid format"
}
}
Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Invalid or missing API key |
| FORBIDDEN | 403 | Access denied |
| NOT_FOUND | 404 | Resource not found |
| INVALID_REQUEST | 400 | Invalid request parameters |
| INVALID_LICENSE | 400 | License validation failed |
| SERVER_ERROR | 500 | Internal server error |
Rate Limiting
Rate Limits
- Free tier: 100 requests per hour
- Standard tier: 1,000 requests per hour
- Enterprise tier: Unlimited
Rate Limit Headers
Each response includes rate limit information:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642521600
Webhooks
Webhook Events
Subscribe to events:
- license.activated
- license.expired
- license.updated
- license.verification_failed
Webhook Payload
{
"event": "license.activated",
"timestamp": "2025-01-18T12:00:00Z",
"data": {
"license_id": "lic_123",
"type": "cPanel",
"server": "server.example.com"
}
}
Code Examples
PHP Example
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://api.licensetube.com/api/v1/license/status';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $api_key,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo $data['status'];
?>
Python Example
import requests
api_key = 'YOUR_API_KEY'
url = 'https://api.licensetube.com/api/v1/license/status'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
data = response.json()
print(data['status'])
cURL Example
curl -X GET \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
https://api.licensetube.com/api/v1/license/status
Best Practices
- Always use HTTPS for API requests
- Keep your API key secure
- Implement proper error handling
- Use exponential backoff for retries
- Cache responses when appropriate
- Monitor rate limits