The Evolution of RPA
Robotic process automation (RPA) has taken the world by storm in recent years by automating mundane tasks that humans perform manually, providing vast productivity gains. After years of automation being relegated to IT departments, RPA has progressed to what it is today—decentralized automation accessible to all employees throughout an organization, from citizen developers to power users.
In previous papers, we’ve discussed considerations when evaluating RPA tools and the four pillars of robotic process automation, and in this paper, we’ll focus on the API integration pillar. In subsequent papers we will go more in depth on the other pillars including GUI automation, native actions, and intelligent automation.
API Integration
Unlike UI automation which mimics the keystrokes and mouse actions that a user performs, API integration is a foreign concept to the citizen developer. After all, API is short for Application Programming Interface. It is essentially a programming concept.
In UI automation when using a web browser to access a web application, the browser masks the complexities associated with using APIs and presents a user-friendly UI for interacting with that application. The web browser presents a very user-friendly interface using login screens, easy-to-navigate menus, nicely laid out forms for submitting data, and formatted tables to read data. Duplicating the user interactions using UI automation is an easy exercise for the citizen developer.
Related Content > RPA vs. API: Differences and Use Cases
So why would an RPA user want to use API integration over UI automation? First, APIs are less likely to change. Changes to a web page, whether it be caused by an update or because the user resized or moved the browser, can cause an automation to fail. Second, while web forms and tables can easily be digested by humans, automating the data movement—like copy and paste—and the human decisions behind these actions such as picking a particular item from a drop-down list or only certain rows from a table that match certain criteria, is a challenging exercise.
In contrast, API integration tasks are far more robust. Even when APIs are updated, the server tends to support the older version for some period giving the RPA user an opportunity to migrate to the new API and avoid unexpected failures and disruptions to their automations. Second, it is far easier to model the human decision process in API integrations. Finally, API integration tasks can run in the background so they can be executed while the user continues to use their computer for other tasks.
Similar to browser pages, the key to making web APIs accessible to the broader non-technical user base is for the RPA tool to mask the complexities involved in working with web APIs.
In the following sections, we’ll discuss the three-step process of using an API, that is, authentication, accessing the APIs, and processing the data. And for each step, we’ll discuss how RPA tools can mask the complexities of using APIs and thereby make it more accessible to citizen developers.
Web APIs
Web APIs are the list of services or endpoints exposed by a web application such as Google, SAP, or Salesforce. Each endpoint is a function that a user can call programmatically to create, retrieve, update, or delete information. Generally, an RPA task that accesses web APIs would invoke multiple endpoints from one or more web applications in order to perform some function such as underwriting a loan application, creating a sales invoice record, or generating a sales report, for example.
Generally, APIs intended to support integration are designed so that its function can be easily understood by non-programmers. For example, the following Google API allows the user to create a Spreadsheet:
const spreadsheet = Sheets.Spreadsheets.create(sheet);
The name is indicative of its function. With a bit of explanation, a non-technical user can figure out how to use these APIs. But to use web APIs, the user must also understand how to navigate the authentication mechanisms in order to gain access to the web APIs and how to work with the data being passed back and forth.
Authentication
Authentication is how a web application confirms who you are. This is usually accomplished via a login process. There are many standard authentication protocols used by web applications. The simplest is basic authentication which requires the user to provide their username and password. However, this is considered a weak protocol. The most common protocol used by web applications today is OAuth2.
The OAuth2 authentication process is multi-step and has many flavors called “flows”. The steps used in each flow differ. Some flows require that the application, in our case the RPA tool, register with the web application provider (e.g., Google, SAP, etc.). Registration is a one-time activity, and each web application provider will have their own registration process. The registration process for an individual web application is generally provided by the web application provider.
At a high level, the OAuth2 authentication process involves an authorization request by the RPA tool, which, if successful receives an access token and optionally a refresh token. The RPA tool uses the access token to access the endpoints. This is generally referred to as the “handshake.” To guard against fraudulent activity, access tokens are only valid for a certain period, and the web application may invalidate it at any time. When access tokens are invalidated, the RPA application must use the refresh token to receive a new access token or go through the authentication process all over again.
Sounds complicated? It definitely is. However, similar to how a browser page masks the complexities of the authentication process, an RPA tool that targets the citizen developer needs to mask the complexities of the handshake and token refresh processes from the user. As a result, with a little bit of training, a citizen developer turned power user should be able to setup the authentication process for API integration.
Processing the Data
The primary reason to interact with Web APIs is to read, add, update, or delete information in the web application. But APIs are designed to interact with other computer systems, not humans. As such, the data that is transmitted is optimized for machine-to-machine communications.
The most common formats for machine-to-machine data transmission are XML and JSON. Given below is a very simple Year-to-Date Sales Report in JSON.
{"CRM Year-to-Date Regional Sales Report":{"Report Date":"03/15/2020","Report Items":[{"Region":"APAC","Total":55500.00},{"Region": "EMEA", "Total":76000.00},{"Region":"NA", "Total":105000.00}]}}
Working with data optimized for computer consumption is the most challenging aspect of working with APIs for the citizen developer. XML and JSON are data formats that a computer can understand much more easily than a human. The challenge for an RPA tool is to mask the complexities of this “machine-readable” format and present the data in a human readable from. For example, the above JSON message can be formatted as given below, which a citizen developer can easily understand.
CRM Year-to-Date Regional Sales Report Report Date: 03/15/2020 Report Items Region: APAC, Total: 55500.00, Region: EMEA, Total: 76000.00, Region: NA, Total: 105000.00
By transforming the raw data to a human readable form similar to what a web page would do, the data can also be made accessible to the power user.
Pre-Built Connector Bots
As we’ve discussed, API integration may not be the ideal RPA approach for the casual citizen developer. But with some basic training and support from the RPA tool, the user can become quite proficient in working with APIs.
Today, RPA tools can go even further to make API integrations available to the non-technical user. Since many of these third-party web applications are used by many users, the RPA tool can provide pre-built “connectors,” that is, pre-built bots that are configured to connect to these web applications. Obviously, the customer will need to configure the pre-built bot as the usernames and passwords would be different but having a pre-built bot makes it even easier for the user to work with APIs. And in cases where the work that each user performs is similar regardless of organization, such as, generating common reports, the bot can include all the steps to complete the task. These bots are called solution bots as they go beyond just setting up the connection to the APIs. They are pre-configured to perform the common business task as well.
Why Automate RPA for Web APIs?
Considering the advantages of API integration over UI automation, RPA tools must make API integration available to the citizen developer. Automate, the RPA tool from Fortra, does just that. Automate takes a no-code approach to automation that makes it easy for citizen developers to automate their work. The Automate API integration framework is no different.
Automate provides a form-based interface for the user to setup authentication and hides all the complexities of the handshake and token management from the user. Automate also provides a formatted visual reorientation of the JSON output which makes it easy for the non-technical user to work with JSON data files. And finally, the Automation Connector Hub provides many pre-built connector and solution bots for our customers.
Automate is consistently rated at the top for its ease-of-use by users and analyst alike. Automate provides easy to use RPA across all four pillars of RPA, including our unique step recorder for UI automation, an easy-to-use API integration framework, native actions, and a best of breed approach to intelligent automation. Our easy-to-use approach to RPA has many advantages. It makes all forms or automation accessible to the citizen developer, and it minimizes technical debt as customers can create and maintain their own automations. This makes Automate a more attractive solution from the total-cost-of-ownership point of view as well.
Get Started Working with Web APIs
Whether you’re a citizen developer or power user, easily bring together your most critical applications and build powerful automation with a free trial of Automate.