Skip to content

BountySite Backup API

Introduction

BountySite allows you to manage backups using REST API, to create your own frontend user interface. Every site created has its own API Key. API Keys are used to manage each site account individually, and are restricted to source IP address for added security. API URL is unique for every hosting provider/reseller.

To get started, you need the below:-

  • Get BackupAPI URL from your hosting provider. Eg api-{provider}.bountysite.com
  • Copy Backup API key from your BountySite control panel

Backup API Key Menu

Top menu API Key

Backup API Key Page

Manage API Key ACL

Manage API Key ACL page:-

  • Click on Copy button to copy API Host/URL to your clipboard, for API URL
  • Click on Copy button to copy API Key to your clipboard, for API Key
  • By default API is blocked for public access. To allow your host to make API calls, add your public internet IPaddress in CIDR format(x.x.x.x/32 or range x.x.x.x/28). You can give multiple IPs separated by commas.

Example

BountySite Backup REST API needs Authorization and Sitename http headers for all APIs. Individual API have their own mandatory parameters. Every API calls returns with a status parameter, which notifies if the requested action was performed successfully.

Required information Example:-

Name Sample value
Authorization 7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN
Sitename dinsite008.com
BS API URL https://partnerbrand.bountysite.com/BSAPIv1
 $ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey  Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com
 {
"msg": "Success", 
"status": 200
}

 $ #Wrong values 
 $ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey  Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:wrongsite.com  
{
    "msg": "API key and sitename mismatch", 
    "status": 406
}
 $ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com 
{"msg": "Success", "status": 200} 

 $ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN 
{"msg": "API key and sitename mismatch", "status": 406} 

 $ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey   -H Sitename:dinsite008.com  
{"msg": "Authorization header missing", "status": 406} 

 $ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey    
{"msg": "Authorization header missing", "status": 406}  
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1/Backup/ValidateAPIKey --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com
{"msg": "Success", "status": 200} 

 $ # wrong values 
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1//Backup/ValidateAPIKey --header=Authorization:7W9IQFt9yiyVZYHYL99--header=Sitename:wrongljdf.com 
{"msg": "API key and sitename mismatch", "status": 406}

Output JSON

Name Value Description
status 200 200 implies success. Non 200 means that the operation was not successfull
msg Success On non 200 status, msg contains error message. This param is not always present for all APIs. It usually contains message about the operation.

Available Services

The following services are available on BountySite backup API:-

  • Validate API key
  • Run Backup Now
  • Get Backup History
  • Get Revisions
  • Restore

Schedule Backup

Schedule a backup. The backup is pushed to a queue with high priority. If a backup job is previously queued, the request is ignored. No extra parameter needed then the default ones.

URL : /RunBackupNow

$ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow   Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com 
{
    "msg": "Success", 
    "status": 200
}

$ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow   Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com 
{
    "msg": "Job already queued", 
    "status": 200
}
$ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com  
{"msg": "Success", "status": 200} 

$ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs6insite008.com  FWN  -H Sitename:di
{"msg": "Job already queued", "status": 200}
$ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow  --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com  
{"msg": "Success", "status": 200}   
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1/Backup/RunBackupNow  --header=Authorization:7W9IQFt9yiyVZYHYL993-header=Sitename:dinsite008.com  -
{"msg": "Job already queued", "status": 200}  

Output JSON

Name Value Description
status 200 Response Status
msg Success Text message

Backup History

Get previous backup history details. This provides with details of previously run backup jobs.

URL : /History

Mandatory params:-

Name Value Description
backup_type web / database Get backup details of backup for web or database
limit 100 Limit output to last limit number of records
 $ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/History Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com backup_type=web limit=2 
{
    "history": [
        {
            "bytes_backed": 0, 
            "commit_time": "", 
            "start_time": "30-Jun-2018 09:28:28 GMT", 
            "summary": {
                "added": [], 
                "deleted": [], 
                "modified": []
            }, 
            "time_taken": "0.536"
        }, 
        {
            "bytes_backed": 0, 
            "commit_time": "", 
            "start_time": "30-Jun-2018 09:27:37 GMT", 
            "summary": {
                "added": [], 
                "deleted": [], 
                "modified": []
            }, 
            "time_taken": "0.801"
        }
    ], 
    "status": 200
}

 $ http --print b   https://partnerbrand.bountysite.com/BSAPIv1/Backup/History Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com backup_type=database limit=2 
{
    "history": [
        {
            "bytes_backed": 0, 
            "commit_time": "", 
            "start_time": "30-Jun-2018 09:28:29 GMT", 
            "summary": {
                "added": [], 
                "deleted": [], 
                "modified": []
            }, 
            "time_taken": "0.986"
        }, 
        {
            "bytes_backed": 0, 
            "commit_time": "", 
            "start_time": "30-Jun-2018 09:27:38 GMT", 
            "summary": {
                "added": [], 
                "deleted": [], 
                "modified": []
            }, 
            "time_taken": "0.192"
        }
    ], 
    "status": 200
}
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1/Backup/History  --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com  --post-data 'backup_type=web&limit=2'   
{"status": 200, "history": [{"bytes_backed": 0, "start_time": "30-Jun-2018 09:28:28 GMT", "time_taken": "0.536", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}, {"bytes_backed": 0, "start_time": "30-Jun-2018 09:27:37 GMT", "time_taken": "0.801", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}]} $ 
 $ 
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPIv1/Backup/History  --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com  --post-data 'backup_type=database&limit=2'   
{"status": 200, "history": [{"bytes_backed": 0, "start_time": "30-Jun-2018 09:28:29 GMT", "time_taken": "0.986", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}, {"bytes_backed": 0, "start_time": "30-Jun-2018 09:27:38 GMT", "time_taken": "0.192", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}]} $ 
$ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/History -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com  -d 'backup_type=web&limit=2' 
{"status": 200, "history": [{"bytes_backed": 0, "start_time": "30-Jun-2018 09:28:28 GMT", "time_taken": "0.536", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}, {"bytes_backed": 0, "start_time": "30-Jun-2018 09:27:37 GMT", "time_taken": "0.801", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}]} $ 

$ curl -o  -  https://partnerbrand.bountysite.com/BSAPIv1/Backup/History -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com  -d 'backup_type=database&limit=2' 
{"status": 200, "history": [{"bytes_backed": 0, "start_time": "30-Jun-2018 09:28:29 GMT", "time_taken": "0.986", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}, {"bytes_backed": 0, "start_time": "30-Jun-2018 09:27:38 GMT", "time_taken": "0.192", "commit_time": "", "summary": {"deleted": [], "added": [], "modified": []}}]}

Output JSON :

Name Value Description
status 200 Response status
msg On non 200 status, contains error message
history
bytes_backed Total bytes downloaded in the backup
commit_time 2018-05-23 07:44:20 UTC Time in UTC, when changes were committed. Empty values imply that there were no changes.
start_time 23-May-2018 07:44:12 GMT Time in GMT/UTC, when backup process was picked from backup queue to run
summary['added'] [List of files] Contains list of files that were downloaded, assuming it was a new file in site
summary['modified'] [List of files] Contains list of files that were downloaded, assuming it was modified
summary['deleted'] [List of files] Contains list of files deleted at website
time_taken 10.579 Time taken in seconds between, the backup job picked from backup queue to committing changes in version control system

Get Revisions

Get history of file changes. This is different from Backup history as this shows changes made to the backup repository. The change could be caused backup, optimize pagespeed, security patches.

URL : /Revisions

Mandatory params:-

Name Value Description
backup_type web / database Get backup details of backup for web or database
limit 100 Limit output to last limit number of records
 $ http --print b   https://partnerbrand.bountysite.com/BSAPI/Backup/Revisions   Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com backup_type=web limit=1 
{
    "revisions": [
        {
            "author_name": "FTP Backup Master", 
            "commit_date": "2018-05-23 07:44:20 UTC", 
            "hash": "56a58dc6822470eb72d646d48296345f3d8e7aa1", 
            "message": "Modified : 0;\nAdded : 1649;\nDeleted : 0"
        }
    ], 
    "status": 200
}
$ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPI/Backup/Revisions  --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com --post-data "backup_type=web&limit=1"
{"status": 200, "revisions": [{"message": "Modified : 0;\nAdded : 1649;\nDeleted : 0", "hash": "56a58dc6822470eb72d646d48296345f3d8e7aa1", "commit_date": "2018-05-23 07:44:20 UTC", "author_name": "FTP Backup Master"}]} 
 $  curl -o  -  https://partnerbrand.bountysite.com/BSAPI/Backup/Revisions -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com  -d "backup_type=web&limit=1" 
{"status": 200, "revisions": [{"message": "Modified : 0;\nAdded : 1649;\nDeleted : 0", "hash": "56a58dc6822470eb72d646d48296345f3d8e7aa1", "commit_date": "2018-05-23 07:44:20 UTC", "author_name": "FTP Backup Master"}]} 

Output JSON :

Name Value Description
status 200 API result status
revisions
author_name BountySite internal Backup Manager
commit_date 2018-05-23 07:44:20 UTC Time in UTC, when changes were committed. Empty values imply that there were no changes.
hash Internal revision hash
msg One line summary of changes

Restore

Restore site web or database to a specific revision of choice.

URL : /RestoreTo

Mandatory params:-

Name Value Description
backup_type web / database Get backup details of backup for web or database
restore_to_version 56a58dc6822470eb72d646d48296345f3d8e7aa1 Hash revision obtained from /Revisions hash value
restore_display 2018-05-23 07:44:20 UTC commit_date value from /Revision. Dummy value to showing commit date, for user view reference only
 $ http --print b   https://partnerbrand.bountysite.com/BSAPI/Backup/Revisions   Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com  backup_type=web limit=10 
{
    "revisions": [
        {
            "author_name": "FTP Restore Manager", 
            "commit_date": "2018-06-30 15:24:50 UTC", 
            "hash": "5fab1455a852041d7fbce0bbe977608918ead20f", 
            "message": "Restore files committed back to master "
        }, 
        {
            "author_name": "FTP Backup Master", 
            "commit_date": "2018-06-30 15:24:43 UTC", 
            "hash": "f1e03c8f6e2f1913087ade6e901751a69bdef47a", 
            "message": "Modified : 0;\nAdded : 1;\nDeleted : 0"
        }, 
        {
            "author_name": "FTP Restore Manager", 
            "commit_date": "2018-06-30 15:23:29 UTC", 
            "hash": "458cf9dfd592b5b9a9e57c2bae1cfc97c1bfa282", 
            "message": "Restore files committed back to master "
        }, 
        {
            "author_name": "FTP Backup Master", 
            "commit_date": "2018-06-30 15:20:10 UTC", 
            "hash": "8155b51dded64bdffb66e2e023b023f057eb9dd3", 
            "message": "Modified : 0;\nAdded : 1;\nDeleted : 0"
        }, 
        {
            "author_name": "FTP Restore Manager", 
            "commit_date": "2018-06-30 14:58:26 UTC", 
            "hash": "2ef2078d012b46da4dbd334e3fd44ae79fbe5b73", 
            "message": "Restore files committed back to master "
        }, 
        {
            "author_name": "FTP Backup Master", 
            "commit_date": "2018-06-30 14:29:35 UTC", 
            "hash": "8fe28b33526cccefa72ab811d05eeea5efdda076", 
            "message": "Modified : 0;\nAdded : 1;\nDeleted : 0"
        }, 
        {
            "author_name": "FTP Backup Master", 
            "commit_date": "2018-05-23 07:44:20 UTC", 
            "hash": "56a58dc6822470eb72d646d48296345f3d8e7aa1", 
            "message": "Modified : 0;\nAdded : 1649;\nDeleted : 0"
        }
    ], 
    "status": 200
}

  $ http --print b   https://partnerbrand.bountysite.com/BSAPI/Backup/RestoreTo   Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN Sitename:dinsite008.com  backup_type=web restore_to_version=56a58dc6822470eb72d646d48296345f3d8e7aa1 restore_display="2018-05-23 07:44:20 UTC"
{
    "msg": "Restore successfull", 
    "status": 200
}
 $ wget --quiet -O - https://partnerbrand.bountysite.com/BSAPI/Backup/RestoreTo  --header=Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN --header=Sitename:dinsite008.com --post-data "backup_type=web&restore_to_version=56a58dc6822470eb72d646d48296345f3d8e7aa1&restore_display=2018-05-23 07:44:20 UTC"  
{"msg": "Restore successfull", "status": 200} 
$ curl -o  -  https://partnerbrand.bountysite.com/BSAPI/Backup/RestoreTo -H Authorization:7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN  -H Sitename:dinsite008.com  -d "backup_type=web&restore_to_version=56a58dc6822470eb72d646d48296345f3d8e7aa1&restore_display=2018-05-23 07:44:20 UTC" 
{"msg": "Restore successfull", "status": 200}

Output JSON :

Name Value Description
status 200 API result status
msg One line summary of changes