You are here:
|
Scan APIs
When you design your Bot, you use the following types of Modules (see "Use Modules"):
-
Modules provided in the RPA subset
-
Modules you create by scanning
This chapter describes how to create Modules by scanning Application Programming Interfaces (APIs).
APIs act as an interface between the user interface and the data layer of an application. In API automation, RPA Studio acts as a client that exchanges requests and responses directly with the API. Generally, APIs tend to be more stable than graphical user interfaces. Consequently, API automation makes for a faster and more stable Bot.
However, API automation requires a working knowledge about the webservice in question and may not be quite as intuitive for business users.
From message to Module
API Modules start out as messages that you create in the API Scan:
-
Request messages to the API.
-
Response messages from the API.
When you export these messages from API Scan to RPA Studio, RPA Studio turns the messages into Modules: Request Modules and Response Modules.
Just like with any other Module, you create Steps from these Modules and tell the Bot what to do. For instance, you can use a Request Module to send data and then save parts of the response with the Response Module.
Open the scan interface
To open the API Scan, follow the steps below:
-
In RPA Studio, right-click a Bot or a folder and select Scan from the context menu, or click on Scan in the RPA menu.
-
In the subsequent dialog, click on API Module.
You can also access the scan in the following ways:
-
Via the Add dialog as described in "Scan your application and add the Module as a Step".
-
When you exchange Placeholders with Steps as described in "Create Placeholders".
Navigate the API Scan
The API Scan window consists of 3 sections:
Section |
Description |
---|---|
1 |
|
2 |
Project tree of the API project structure |
3 |
Sections of the API Scan window
Use the Home menu
The Home menu offers the following options:
Option |
Description |
---|---|
File |
Scan a file or a service. File opens a dialog where you specify the file or service that you want to scan. You can scan the following file types: JSON, RAML, Text, WADL, WSDL, XML, XSD.
|
URI |
Scan a URI or a service. URI opens a dialog where you specify the URI or service that you want to scan. If the URI or service requires authentication or a connection to a proxy server, expand the Advanced section and populate the respective entry fields.
|
Export your messages as API Modules to RPA Studio. |
|
Update existing API Modules if the request or the response structure has changed. This functionality is available for Modules that use Swagger or RAML schemas and contain XML or JSON payloads. |
|
Request |
Show the request message. |
Response |
Show the response message. |
Cookies |
View the domain, name, and value of all stored cookies. If a message contains a cookie, RPA Studio sends it in the subsequent request message. When you close the API Scan window, RPA Studio automatically deletes all stored cookies. You can also manually delete cookies by selecting a cookie and pressing DEL. |
Add a file to your message. You can add a file in the following ways:
|
|
Search in Payload |
Search for strings, regular expressions, and wildcards in the message payload. By default, the search runs from top to bottom. |
Validate |
Validate the XML structure in the payload of a request or response message. You can validate the payload if the following applies:
Double-click an error message to highlight the faulty line in the payload. |
Record |
Disregard. RPA Studio currently does not support API recording. |
Run |
Send the selected message to the API and show the response. |
Use the project tree
The project tree shows all objects, such as folders, operations, and subordinate messages:
Option |
Description |
---|---|
|
Project root of the API project |
|
Service folder |
|
REST Resource |
|
Operation |
|
XML Schema definition |
|
Message |
Use the message section
The message section displays the following information:
Option |
Description |
---|---|
Method |
HTTP Method for the request message. |
Endpoint | API base URL. |
Resource | Resource identifier for the specified endpoint. |
Payload | Message payload. You can edit the payload as described in "Work with API Payload". |
Params | Request and response parameters. You can display and edit parameters as described in "Work with API Parameters". |
Auth | Message authentication. You can configure authentication as described in "configure API authentication". |
Attachments |
Display and edit attachments as described in "Send API attachments". |
Advanced | Configure advanced settings, e.g. select a security protocol and disable automatic HTTP redirects (see the Tricentis Tosca documentation). |
Headers | Headers of the selected message. You can edit them as described in "Edit message headers". |
Status Code |
Available in response messages only. Status Code indicates whether the request has been successfully processed. |
Response Time |
Available in response messages only. Response Time indicates the time in milliseconds between sending the request and receiving the response. |
What's next
Put your API Modules to work! Use them in your Bots.
Or check out an example for an API Bot.