BACK

Using the IQ Bot API to fetch Dashboard Data

August 30, 2021
CATEGORY:

This is a guest post from ChanduMohammad S, a Module Lead and a Senior RPA Developer. If you have an idea for a blog post or tutorial that you think would benefit the Automation Anywhere developer community, let us know at developer@automationanywhere.com.


IQ Bot provides a comprehensive dashboard with details about the documents processed in each learning instance. This data is not only available on the UI, but can also be fetched from the API, so that you can use this data for further processing and custom reporting as per your management needs.

In this article, we will explore how you can use the IQ Bot Dashboard data API to fetch the dashboard data using Postman. You can also use REST action in Automation 360 bot to get the same details.

Kindly note this article is applicable for Automation 360 (formerly Automation Anywhere Enterprise A2019) Enterprise Cloud IQ Bot only as there are limitations with using APIs in the Community Edition.

The outcome of this API is to fetch IQ Bot dashboard data without logging into the IQBOT, providing additional visibility to the management, so that they can track the number of page count consumed w.r.t to each Learning Instance (LI) vs available page count from a licensing standpoint. This is just a single use case listed, but it can be used for preparing multiple reports as needed.

Using This API, we can get all the LI Dashboard data from the CR.

  1. totalFilesProcessed
  2. totalSTP
  3. totalAccuracy
  4. totalFilesCount
  5. totalPageCount
  6. Projects – It lists out all the Individual LI Details
    • id
    • organizationId
    • name
    • description
    • environment
    • primaryLanguage
    • projectType
    • projectState
    • totalFilesProcessed
    • totalSTP
    • numberOfFiles
    • totalAccuracy
    • currentTrainedPercentage
    • totalStagingPageCount
    • totalProductionPageCount

Now, let’s look at how to fetch IQBOT dashboard details without logging into the IQBOT URL.

Here are the steps to authenticate the user without SSO:

Get the Authentication token by passing the below body parameters to get x-authorization token.

URL: {{CR_URL}}/v1/authentication
Body:
{
"username": "Give your Enterprise Username",
"password": "Give your Enterprise Password"
}

Response from the API:

Here are the steps to authenticate the user with SSO – Using API Key instead of the password.

Get the Authentication token by passing the below-mentioned body parameters to get the x-authorization token.

The main difference between SSO & Non-SSO is that instead of a password, you will enter apiKey for getting the x-authorization code.

Here are the steps to get the apiKey from Automation 360 CR:

  1. Login to Enterprise A360 CR
  2. Navigate to your profile >> My Settings >> On the right side you will find a button called “Generate API-Key”
  3. Click on it to get the API-Key for your login

URL: {{CR_URL}}//v1/authentication
Body :
{
"username": "Give your Enterprise Username",
"apiKey": "nwxXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

Response from the API:

If you are using the environment feature in Postman, instead of hardcoded values you can find auto-updated token value in the respective variables.

Now that we have authenticated the user, let’s fetch the data from IQBOT Dashboard Data.

We can get the IQBOT Dashboard Data by passing the below-mentioned header parameters to the URL, and there is no need to pass any parameters in the body.

URL: {{IQBot_URL}}/api/reporting/dashboard
Method: GET
Header: X-Authorization – token & Content-Type -- application/json

Here is the outcome of IQ Bot dashboard data in JSON format.

As you can see in the above screenshot, it contains all the dashboard data of a single learning instance. Similarly, you will be able to see the data related to all the Learning Instances in your CR.

Conclusion

Hopefully, you enjoyed learning how to get the data from IQ Bot Dashboard Data API. Using the IQ Bot Dashboard data API is an easier way to know the summary of the data, keep track of the page count utilization in your IQ Bot instance and also integrate this data in your custom reporting.


ChanduMohammad S

He is a Module lead and a senior RPA Developer with a demonstrated history of working in the information technology and services industry. He is skilled in Automation Anywhere, JavaScript, ASP.NET, C#, and SQL.

When he’s not building bots, you can find Chandu on LinkedIn as well as on the forums of APeople.

Related Articles
API
BLM
Bot lifecycle management
Control Room
export
Bot Lifecycle Management in Automation 360
Exporting and Importing bot/files can be achieved using Control Room UI as well as Control Room APIs. In this article, let's explore the procedure in detail. Read More