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:
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.
- Log on to the inSync Management Console as an inSync Cloud administrator.
- On the inSync Management Console menu bar, click > Settings. The Settings page appears.
- Click the inSync APIs tab. The Access token for inSync APIs page appears.
- Click Copy Token. The token is copied to your clipboard.
The Copy Token button is available only when the authentication token is valid.
- If the token has expired, then click Create New Token and run the following steps:
- In the Expire on field, specify the expiry date of the authentication token.
- Click Done.
- Copy the token and retain it for requesting access to the API.
- 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.
- Download and install the Postman application from the following link:
- Launch the Postman application.
- Now, based on your use case, you can select the GET query. For example,
- If you want to fetch list of devices, use below link:
- If you want to fetch list of users, use below link
- Refer to the following articles for all APIs:
- 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:
- 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)
- Click Send. The expected output or status is 200 OK.
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.
- 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.