How to use the Backup Manager JSON-RPC API schema

The schema for the protocol is currently in beta.

The schema lists available methods and supported parameters, but it cannot be used to generate a client for the service automatically.

The schema can be found here: JSON-RPC schema for Cove Data Protection (Cove) (beta)

Recommendations

Before getting started, we would recommend you either download a JSON API reader plugin for your preferred web browser or use a browser which automatically reads API's and breaks the schema down into sections for you, as this makes it easier to view.

Schema sections

Using a reader or a browser with a built-in reader allows for a much easier view of the schema so that the page is broken down into smaller sections:

Constructing an API call

  1. Ensure the start of the method includes the following, filling in your Visa with one received by running an authorization call:
    {
    	"jsonrpc":"2.0",
    	"visa": "33491-50121-1-1512736778-A99E8BAC8AC82XXXXX0000000XXXXXXXXXXXX00000",
    	"id":"jsonrpc",
    }
  2. Search in the schema for the method you need and add this to the call you are creating:

    "method" : "EnumerateAccountHistoryStatistics",

  3. Add the parameters and fill these in with the criteria you wish to search for:
    {
        "params" : {
    	"query" : {
    	    "PartnerId" : partner-id-number-here,
    	    "StartRecordNumber" : number-of-records-to-start-displaying-from,
    	    "RecordsCount" : number-of-records-to-return,
    	    "SelectionMode" : inside-"..."-one-of-the-values-of-this-field,
    	    "Columns" : in-this-format-["xn","xn","xn"]-the-column-short-codes-to-display,
    	    "Filter" : inside-"..."-apply-any-filter
    	},
    	"timeslice" : before-x-time-in-unix-epoc-time,
    	"totalStatistics" : "*"
        }
    }
    • Look under the method in the Schema for all of the parameters that are available for it. If any of the parameters' type is not int, bool, std::time_t, str::string or IdSet, search in Structs or Enum for the type given
    • If it is an enumeration (list) your API parameter should contain one or more of the given types
  4. Ensure you have closed the brackets and have commas at the end of lines which are followed by another parameter

The combined example query would look something like this:

{
    "jsonrpc":"2.0",
    "visa": "33491-50121-1-1512736778-A99E8BAC8AC82XXXXX0000000XXXXXXXXXXXX00000",
    "id":"jsonrpc",
    "method" : "EnumerateAccountHistoryStatistics",
    "params" : {
	"query" : {
		"PartnerId" : 123456,
		"StartRecordNumber" : 0,
		"RecordsCount" : 5,
		"SelectionMode" : "Merged",
		"Columns" : ["T3", "G3"],
		"Filter" : "Any =~ '*Mac*'"
	},
	"timeslice" : 1665660833
    }
}

For the above query, a sample response would be:

{
    "jsonrpc": "2.0",
    "id": "jsonrpc",
    "result": {
    	"result": [
	    {
		"AccountId": 987654,
		"PartnerId": 123456,
		"Flags": null,
		"Settings": [
		    {
			"AN": "oldmac"
		    },
		    {
			"AT": "1"
		    },
		    {
			"AU": "456789"
		    },
		    {
			"CD": "1536906195"
		    },
		    {
			"ED": "2147483647"
		    },
		    {
			"I0": "456789"
		    },
		    {
			"I1": "oldmac"
		    },
		    {
			"I14": "188702358870"
		    },
		    {
			"I4": "1536906195"
		    },
		    {
			"I5": "2147483647"
		    },
		    {
			"I59": "1"
		    },
		    {
			"I78": "D01"
		    }
		]
	    },
	    {
		"AccountId": 987654,
		"PartnerId": 123456,
		"Flags": null,
		"Settings": [
		    {
			"AN": "homemac"
		    },
		    {
			"AT": "1"
		    },
		    {
			"AU": "876543"
		    },
		    {
			"CD": "1530535000"
		    },
		    {
			"ED": "2147483647"
		    },
		    {
			"I0": "456789"
		    },
		    {
			"I1": "homemac"
		    },
		    {
			"I14": "140287550076"
		    },
		    {
			"I4": "1530535000"
		    },
		    {
			"I5": "2147483647"
		    },
		    {
			"I59": "1"
		    },
		    {
			"I78": "D01"
		    }
		]
	    }
	]
    },
    "visa": "33491-50121-1-1512736778-A99E8BAC8AC82XXXXX0000000XXXXXXXXXXXX00000"
}