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:-
  • gps_fixedGet BackupAPI URL from your hosting provider. Eg {provider}.api.bountysite.com
  • gps_fixedCopy Backup API key from your BountySite control panel
Top menu API Key page


Manage API Key ACL

Manage API Key ACL page:-

  • chevron_righta : Click on Copy button to copy API Host/URL to your clipboard, for API URL
  • chevron_rightb : Click on Copy button to copy API Key to your clipboard, for API Key
  • chevron_rightc : 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:-

NameSample value
Authorization7W9IQFt9yiyVZYHYL993ObZwkZMZYOYs61Eje8mHu1ILte2qFWN
Sitenamedinsite008.com
BS API URLhttps://partnerbrand.bountysite.com/BSAPIv1


 $ 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}
 

 $ 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
}


   
Output JSON
NameValueDescription
status200200 implies success. Non 200 means that the operation was not successfull
msgSuccessOn 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

Available Services are available on BountySite backup API:-
  • done_allValidate API key
  • done_allRun Backup Now
  • done_allGet Backup History
  • done_allGet Revisions
  • done_allRestore
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


 $ 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} $
 

 $ 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
}
   
Output JSON
NameValueDescription
status200Response Status
msgSuccessText message
Backup History

Get previous backup history details.

URL : /History
Mandatory params:-
NameValueDescription
backup_typeweb | databaseGet backup details of backup for web or database
limit100Limit output to last limit number of records


  $ 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": []}}]} $ 

 $ 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": []}}]} $ 

 

 $ 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
}


   
Output JSON :
Name ValueDescription
status200Response status
msg{string}On non 200 status, contains error message
history{}arrow_downward
bytes_backed{Long}Total bytes downloaded in the backup
commit_time2018-05-23 07:44:20 UTCTime in UTC, when changes were committed. Empty values imply that there were no changes.
start_time23-May-2018 07:44:12 GMTTime 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_taken10.579Time 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 .

URL : /Revisions
Mandatory params:-
NameValueDescription
backup_typeweb | databaseGet backup details of backup for web or database
limit100Limit output to last limit number of records


 $  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"}]} $ 


$ 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"}]} $ 

 

 $ 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
}

   
Output JSON :
NameValueDescription
status200API result status
revisions{}arrow_downward
author_name{string}BountySite internal Backup Manager
commit_date2018-05-23 07:44:20 UTCTime in UTC, when changes were committed. Empty values imply that there were no changes.
hash{string}Internal revision hash
msg{string}One line summary of changes
Restore

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

URL : /RestoreTo
Mandatory params:-
NameValueDescription
backup_typeweb | databaseGet backup details of backup for web or database
restore_to_version56a58dc6822470eb72d646d48296345f3d8e7aa1Hash revision obtained from /Revisions hash value
restore_display2018-05-23 07:44:20 UTCcommit_date value from /Revision. Dummy value to showing commit date, for user view reference only


$ 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} $

 $ 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} $ 
 

 $ 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
}



   
Output JSON :
NameValueDescription
status200API result status
msg{string}One line summary of changes
arrow_upward