Integrating APIs with UiPath enables automation workflows to interact with external systems, enhancing the capabilities of your RPA projects. This tutorial will guide you through the process of setting up API connections in UiPath, from understanding APIs to configuring HTTP requests.

Table of Contents

  • Understanding APIs
  • Preparing UiPath for API Integration
  • Configuring an HTTP Request in UiPath
  • Practical Example: Making a GET Request
  • Practical Example: Making a POST Request
  • Conclusion

Understanding APIs

APIs (Application Programming Interfaces) allow different software systems to communicate with each other. They provide a way to interact with web services, enabling the retrieval and submission of data.

Fig1: Diagram illustrating how APIs work (client-server interaction).

Illustration of how HTTP GET and POST API connections work in UiPath

Preparing UiPath for API Integration

Before you start, ensure that you have the necessary packages installed in UiPath Studio.

1.) Install UiPath.WebAPI.Activities:

  • Open UiPath Studio.
  • Go to Manage Packages.
  • Search for UiPath.WebAPI.Activities and install it.

Fig2: Screenshot of UiPath Studio with the Manage Packages window open.

UiPath Studio with the Manage Packages window open

Configuring an HTTP Request in UiPath

  1. Add the HTTP Request Activity:
    • Drag and drop the HTTP Request activity into your workflow.
  2. Configure the Endpoint:
    • In the properties panel, set the Endpoint to the URL of the API you want to connect to.
  3. Set HTTP Method:
    • Choose the appropriate HTTP method (GET, POST, PUT, DELETE, etc.) based on your API requirement.

Fig3: Screenshot showing the HTTP Request activity properties configuration.

RPA Tutorials HTTP Request activity properties configuration.

Practical Example: Making a GET Request

  1. Configure a GET Request:
    • Set the Method to GET.
    • Enter the API endpoint URL.
  2. Add Parameters (if required):
    • Use the Parameters section to add any required parameters.
  3. Handle the Response:
    • Store the response in a variable using the Response property.

Fig4: Screenshot of a configured GET request in UiPath.

RPA Tutorial configured GET request in UiPath.
RPA Tutorial configured GET request in UiPath.

Fig5: Example of JSON response data.

RPA Tutorial Example of JSON response data.

Practical Example: Making a POST Request

  1. Configure a POST Request:
    • Set the Method to POST.
    • Enter the API endpoint URL.
  2. Add Headers and Body:
    • Use the Headers section to add necessary headers (e.g., Content-Type: application/json).
    • Enter the request body in the Body section.
  3. Handle the Response:
    • Store the response in a variable using the Response property.

Fig6: Screenshot of a configured POST request in UiPath.

RPA Tutroial configured POST request in UiPath.

Fig7: Example of a POST request payload.

RPA Tutorails POST request payload

Fig8: Example of JSON response data.

RPA Tutorial JSON response data.

Conclusion

Setting up API connections in UiPath significantly enhances your automation capabilities by allowing you to interact with various web services. By following this guide, you can integrate APIs into your workflows, making them more dynamic and responsive.