Skip to main content
Druva Documentation

How to use inSync APIs using the Postman application

Overview

This article helps you to consume Druva inSync Reporting APIs using the Postman application.

These inSync APIs are over and above the API

You can access APIs using the following two steps:

  1. Create API Credentials
  2. Access the inSync APIs through the Postman application

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 inSync APIs to run the reports.

Step 1: Create API Credentials

inSync uses HTTP Basic authentication for API requests. inSync Cloud administrator can create the authentication information from the inSync Management Console.

The authentication information consists of the following components:

  • Username: Email ID of the inSync Cloud administrator who creates the authentication token.
  • Password: Authentication token that is generated.

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

To obtain the authentication information:
  1. Log on to the inSync Management Console as an inSync Cloud administrator.
  2. On the inSync Management Console menu bar, click wheel.png > Settings. The Settings page appears.
  3. Click the inSync APIs tab. The Access token for inSync APIs page appears.
  4. Click Copy Token. The token is copied to your clipboard.
    The Copy Token button is available only when the authentication token is valid. 
  5. If the token has expired, then click Create New Token and run the following steps:
    1. In the Expire on field, specify the expiry date of the authentication token.
    2. Click Done.
  6. Copy the token and retain it for requesting access to the API.

Note:

  • By default, the token is valid for 30 days. The token's expiry date can be anywhere between 1 day to 365 days. You can create a new token even if the existing token is valid, if you feel that the token is compromised.
  • Ensure that you keep the Client ID and the Secret Key safe and saved at another location as a backup.

Step 2: Access the inSync APIs through the Postman application

inSync uses basic authentication, which requires you to provide your username and password (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

  1. Download and install the Postman application from the following link:
    https://www.postman.com/downloads/
  2. Launch the Postman application.
  3. Now, based on your use case, you can select the GET query. For example,
  1. Let’s go with the list of users API, to fetch details, use the command in the above format as GET Query in Postman application:
    API_req1.jpg
     
  2. Click on the Authorization tab and select Type as Basic Auth, and then enter ‘Username’ and ‘password’ ( This username and password is what you have created in Step 1 above i.e. ‘Username’ in postman app is the email address under ‘Generated by’ and ‘password’ is what you get after ‘copy token’ under ‘inSync API’ tab in ‘Settings’ in inSync Management Console)
    API_req2.jpg
    API_req3.jpg
     
  3. Click Send. The expected output or status is 200 OK.
    API_req4.jpg
  4. As per above screenshot, you found 234 counts for users in this instance. The output is found to be in JSON format. As per your choice, you can get it in xml, html, text format as well.
    API_req5.jpg

  5. Once you have verified the query via postman app, you can use this link in any browser and get the output file in JSON format. Enter the same credentials being used earlier as an Authentication in Postman app and once you hit ‘Sign in’, we will be able to get the output in json format.API_req6.jpg