Overview
This article helps you to consume Druva Reporting APIs using the Postman application. You can achieve specific use cases apart from the existing reports available on the Druva Cloud Platform Console (DCP). For example, you can trigger APIs to fetch information in reports in addition to the details that Phoenix provides. You can access APIs using the following two steps:
๐ Note
โ Postman application is being used for demonstration purposes only. You can use any other application or scripting language to execute the API calls.
This article describes how to use the DCP APIs to run the reports.
Step 1: Create API Credentials
Review the following points:
Third-party applications and tools can access Druva REST APIs only if the third-party applications and tools are successfully authenticated using API credentials. The API credential is a combination of the Client ID and Secret Key and is equivalent to that of a username and password.
As a Druva Cloud Administrator, you can create and manage API credentials from the Druva Cloud Platform Console. As a Druva Cloud administrator, you can also provide these API credentials to the developers within your organization to integrate various applications, tools, services, scripts with Druva products.
inSync stores the authentication information in the database that is encrypted with the ekey of your organization. Whenever you request to access the API, you must specify the username and the password.
Procedure
Perform the following steps to obtain the API Credentials (Client ID and Secret Key)
Click the Druva logo
> Druva Cloud Settings.
โOn the Settings page, click API Credentials.
The API Credentials page appears.
โClick New Credentials.
The New Credentials window appears.Provide a name for the credential.
๐ Note
โ For ease of recognizing the credential name, it is recommended to name the credential so that it matches the name of the application or tool that you intend to integrate with Druva products.Click Save and you will get your new credentials, the Client ID and the Secret Key.
โ
Ensure that you keep the Client ID and the Secret Key safe and saved at another location as a backup.
Step 2: Access the DCP APIs through the Postman application
DCP uses basic authentication, which requires you to provide your Client ID and Secret Key (created in Step 1) to authenticate each API request.
You need to fetch report data and store it in a local database. You can consume this stored data by integrating with third-party Business Intelligence (BI) tools, and generate reports and get data insights. We are going to use the Postman app, as an example, for simplicity.
๐ Note
โ You can any other application as per your requirement.
Procedure
Download and install the Postman application from the following link:
https://www.postman.com/downloads/
Launch the Postman application.
Now, based on your use case, you can select the GET query. For example,
To fetch the device mapping list, use the following link:
โhttps://apis.druva.com/insync/endpoints/v1/devicemappings
To fetch the device information, use the following link:
โhttps://apis.druva.com/insync/endpoints/v1/devices/deviceID
Refer to the following article for all APIs:
โhttps://developer.druva.com/reference
Letโs go with the listing device mappings details, to fetch details, use the command in the above format as GET Query in Postman application:
โClick on the Authorization tab and select Type as OAuth 2.0, and click Get New Access Token.
โClick Get New Access Token. The GET NEW ACCESS TOKEN window appears.
โEnter the following details:
Token Name: Specify a name to the token.
Access Token URL: Specify the following url
https://apis.druva.com/token
Client ID: Enter the Client ID generated in Step 1.
Client Secret: Enter the Secret Key generated in Step 1.
Click Request Token. A new window to use the token appears as shown in the following screenshot:
โClick Use Token.
You can now view the token generated in the Get list.
โClick Send. The expected output or status is 200 OK.
โAs per the previous screenshot, you found 9 mappings in this instance. The output is in the JSON format. You can also view the output in the XML, HTML, and Text formats.
โAfter you verify the output using the Postman application, you can use an internal tool to work with a JSON file or convert it into a CSV format using online tools.