Druva Developer Portal

Welcome to the Druva developer portal — your one stop for the knowledge and resources to start integrating with Druva data protection and management products. The portal has comprehensive guides, reference materials, and more.

Getting Started with CloudRanger API trial

Instructions and samples to get started using the Druva CloudRanger API

This is where you show your users how to set it up. You can use code samples, like this:

Authentication

Druva CloudRanger supports OAuth 2.0 based authentication for API requests. The following is the process to generate an authentication token to access the API requests. Sample scripts enable you to automate the process of generating the token and access Druva CloudRanger APIs.

Follow the instructions below to authorize and send a simple request to the CloudRanger API

Step 1

In order to start making requests with the CloudRanger API, users must first register for an API key to authenticate the requests.
You can retrieve your API key from the User Settings page in your CloudRanger account by clicking User Settings

To do this, authenticate with the GET request sample below:

curl --request GET \
  --url https://api.cloudranger.com/202004/authorize \
  --header 'accept: application/json' \
  --header 'x-api-key: 2qop3RkZY6t.................................'
var request = require("request");

var options = {
  method: 'GET',
  url: 'https://api.cloudranger.com/202004/authorize',
  headers: {accept: 'application/json', 'x-api-key': '2qop3RkZY6t.................................'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

This will return a token for use a Bearer Authentication for use in further calls

{"token":"eyJhbGdgdggfdggdgfSEGqUw9TvRrdRwxxxxxxxxx"}

Step 2

Using the token returned in step 1, execute the accessible accounts GET request below which will return a list of accounts that you can perform API requests against.

curl --request GET  --url https://api.cloudranger.com/202004/organizations/t7GfxgtC/accounts
 --header 'accept: application/json'
 --header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyE1ODg5NDUwMsXXXXXXXXXXXXXX'
 --header 'x-api-key: 2qop3RkZY6t.................'
var request = require("request");

var options = {
  method: 'GET',
  url: 'https://api.cloudranger.com/202004/organizations/organization_id/accounts',
  headers: {accept: 'application/json', 'x-api-key': '2qop3RkZY6t.................................', 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cXXXXXXXXXXXXXXX''}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

This call will return json data with a list of accounts like the following

{
    "id":"isfsyJs35",
    "organization_id":"sdfdsfsdfsd",
    "name":"Default Account",
    "initials":"DA",
    "color":"rgb(121,123,243)",
    "avatar_image":null,

Updated 5 months ago


What's Next

The Full API is available in the API Reference

CloudRanger APIs

Getting Started with CloudRanger API trial


Instructions and samples to get started using the Druva CloudRanger API

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.