How to Backup IQ Bot Learning Instances using API

  • 15 December 2021
  • 0 replies
  • 63 views

Userlevel 4
Badge +8

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.


 

In this tutorial, we will look at how to create the backup of IQBOT Learning Instances i.e .IQBA extension files.

Let’s first try to understand what is IQBA file and why backup is required before we proceed further.

A learning instance in IQBOT is exported as IQ Bot archive i.e., IQBA file. Groups, bots, and learnings associated with the learning instance are also exported during this process. Creating IQBA file is required to take a backup of existing Learning Instances and it can also be deployed to other Environments [UAT or Prod] once the training & testing is completed.

Here’s a visual overview of everything in this workflow.

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

Here are the pre-requisites to create IQ Bot archive:

  • User should have “AAE_IQ Bot Admin” Role to perform this task.
  • Steps to Generate APIKey from 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

Now, let’s look at how to create the backup of IQ Bot’s Learning Instances. Here are the manual steps using UI to take the backup.

Login to Automation 360 IQBOT with an id that has IQ Bot Admin privileges.

Click Administration and then Migration as shown below.

Migration Management page will be displayed. Click 'Create Backup'.

Select the Learning Instance to be backed up and Click 'Backup'.

Once the backup file is generated, it will be displayed in the table as shown below. Click 'Download'.

.IQBA file will get downloaded to your local drive.

Now let's look at how we can do these steps with IQ Bot API.

 

Step 1: Getting the Authentication token

Use the below endpoint with the POST method and send a request to generate the authentication token.

Method:POST

URI:{{ControlRoomURL}}/v1/authentication

Headers:

Body:

{

"username": "{{UserName}}",

"apiKey": "{{APIKey}}"

}

API returns the Authentication Token as shown below.

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

 

Step 2: Create LI Backup

Once the authentication token is available, use the below endpoint with the POST method and send a request to create the backup.

Method: POST

URI:{{ControlRoomURL}}/IQBot/api/projects/export/start

Headers:Key:x-authorization, Value:{{token}}

Body:

{ "projectExportDetails": [

"{{LI ID}}"

],

"archiveName": "MeetupBackup",

"userId": "{{UserName}}"

}

  • {{LI ID}} – Provide the ID of Learning Instance which you are planning to archive. Ex: b6fXXXXX-bXX0-4XX0-9X4a-cbXXXX93a492
  • archiveName – Provide the Archival Name
  • {{UserName}} – Provide the Login ID or User Name of the CR. Ex: userid@gmail.com

Response from the API returns the confirmation of backup created as shown below.

 

Step 3: GETArchiveDetails

Now that you’ve created the backup, the next step is to get Archive Details.

Use the below endpoint with the GET method and send a request to fetch the archive details from the previous step.

Method: GET

URI:{{ControlRoomURL}}/IQBot/api/projects/archivedetails

Headers:Key:x-authorization, Value:{{token}}

Body:

Response from the API returns the archive details as below. Copy the “archiveId” from the response body, and it will be used to physically download the IQBA file in the next step.

 

Step 4: Download Archive File

Now that you have the “archiveId”, you can download the backup or archive file to your local drive.

Use the below endpoint with GET method and send a request to download the backup file.

Method: GET

URI:{{ControlRoomURL}}/IQBot/api/backups/{{FileID}}/download

Headers:Key:x-authorization, Value:{{token}}

Body: Paste the copied “archiveId” in the URI as shown below or you can pass this from the Postman Environment variable. {{ControlRoomURL}}/IQBot/api/backups/0f31b8c0-5455-42a9-b5a5-8f648d5d00ad/download

Response from the API is in binary format. Save the Response to your local drive and change the extension of the file from .zip to. iqba

 

Conclusion

Hopefully, you enjoyed learning how to create the backup of IQBOT via API’s. Using API’s is an easier way to create backups of all the LI’s within CR and deploy them to different Environments such as UAT or Prod with ease.

 


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. In his free time, he enjoys binge-watching, cooking and playing tennis.

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


0 replies

Be the first to reply!

Reply