UiPath REST API Call

Hi,

I am trying to make an API call but unable to do so in UiPath. Can anyone create a dummy flow to call this API? Here is the CURL command:

@Umer_Shahid,

Looks you need to use “GET” method of the API to get the work order details. But you are using POST in your current request. For RestAPI calls from UiPath you can use RestSharp nuget package with Invoke code activity… that will help.

using RestSharp;

namespace RestSharpExample
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new RestClient("https://api.example.com");
            var request = new RestRequest("resource", Method.GET);
            IRestResponse response = client.Execute(request);

            Console.WriteLine(response.Content);
        }
    }
}

You can use “Chrome Tabbed Postman Extension” to test with the restAPI calls.

  1. Install the Chrome tabbed postman extension from the Chrome Web Store.
  2. Open Google Chrome and click on the three dots in the upper-right corner of the browser.
  3. Select “More tools” and then “Extensions.”
  4. Scroll down until you find the tabbed postman extension and click on it.
  5. In the extension details page, click on the “Options” button.
  6. A new window will open. Configure the settings for your extension as desired.
  7. To use the tabbed postman extension, simply click on the postman icon in the Chrome toolbar.
  8. The postman interface will appear in a new tab. You can create and send requests, see the response, and manage collections just as you would with the standalone Postman application.

@sarathi125 its a POST call.

@sarathi125 can you make a flow and call this endpoint?

@Umer_Shahid,

Check this
Call_RestAPI.zip (3.0 KB)

Tried your flow. It’s a POST call not get. Still not working.

@Umer_Shahid,
For GET method only we are getting response from the API,

For POST getting exception, I am not sure what you are trying to do with this API, are you going to get WordOrders or create WorkOrders,

Fixed it. Issue was in request body.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.