Virtualmin Example
Indicate the start of a daily backup job:
GET "https://backupdashboard.com/api/v1/job?api_token=secret&frequency=daily&type=incremental&status=start&integration=virtualmin"
Indicate the successful completion of a backup job. Note, you do not have to specify the integration again.
GET "https://backupdashboard.com/api/v1/job?api_token=secret&frequency=daily&type=incremental&status=success"
Generic Example
Indicate the start of a backup job:
GET "https://backupdashboard.com/api/v1/job?api_token=secret&frequency=daily&type=incremental&status=running"
Indicate the successful completion of a backup job:
GET "https://backupdashboard.com/api/v1/job?api_token=secret&frequency=daily&type=incremental&status=success"
Indicate that a backup job has failed:
GET "https://backupdashboard.com/api/v1/job?api_token=secret&frequency=daily&type=incremental&status=error"
Check for CURL
Go to terminal
php -m | grep curl
If CURL isn't loaded, use the Python script
import requests
import json
import sys
url = "https://backupdashboard.com/api/v1/job?api_token=secret"
# Prepare the data to be sent
data = json.dumps({'jetbackup_pre_hook': sys.argv})
# Set headers
headers = {
'Content-Type': 'application/json',
}
# Send the POST request
response = requests.post(url, data=data, headers=headers)
# Print response (optional, for debugging)
print(response.status_code)
print(response.text)
JetBackup Pre-Hook Example
<?php
$url = "https://backupdashboard.com/api/v1/job?api_token=secret";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['jetbackup_pre_hook' => $argv]));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
?>
JetBackup Post-Hook Example. The only difference is `jetbackup_post_hook` instead of `jetbackup_pre_hook`.
<?php
$url = "https://backupdashboard.com/api/v1/job?api_token=secret";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['jetbackup_post_hook' => $argv]));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
?>