UiPath Activities Guide

HTTP Request

UiPath.Web.Activities.HttpClient

Enables you to perform HTTP requests to a specified web API. When first dragging this activity to the Designer panel, the HTTP Request Wizard window is displayed, providing an easier way of building requests and previewing server responses.

Note:

The wizard cannot be opened a second time.

All the fields present in this window are also available in the Properties panel. As a result, you can still edit your preferences after closing the wizard.

The HTTP Request Wizard Window

The Request Builder Tab

  • End Point - The URL to which you want to make the request. Custom segments have to be placed between braces "{}" and defined in the Parameters section. For example, this URL https://platform.uipath.com/odata/Robots(28) can be written as https://platform.uipath.com/odata/Robots({id}), and the value of the id parameter can be provided in the Parameters section, as a UrlSegment.
  • Preview URL - A preview of the URL provided in the End Point field, taking into account the information provided in the Parameters section.
  • Timeout - Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown. The default value is 6000 milliseconds (6 seconds).
  • Client Certificate - The location in which the Client Certificate file is stored. The full path must be provided.

Note:

The path must not be written between quotation marks.

  • Client Certificate Password - The password that corresponds to the Client Certificate file you are using.
  • Request Method - The request method to be used when calling the API. The following HTTP verbs are supported: GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH and MERGE. By default, the GET method is selected.
  • Accept response as - The format in which to receive the web server's response. The following options are supported: ANY - the default value, XML and JSON.
  • Authentication - Specifies the authentication protocol to be used when calling the API. The following protocols are supported:
    • None - The default option. It should be used if the web server you are sending requests to does not require an authentication protocol.
    • Simple Http - This option has to be selected if the API you are making requests to uses a simple HTTP authentication protocol. If chosen, two additional fields are displayed - Username and Password, which have to be filled in with valid credentials for the specified API.
    • OAuth1 - This option has to be selected if the API you are making requests to uses an OAuth1 protocol. If chosen, four fields are displayed: Consumer Key, Consumer Secret, Access Token, Access Token Secret.
    • OAuth2 - This option has to be selected if the API you are making requests to uses an OAuth2 protocol. If chosen, the Access Token field is displayed. This access token is usually generated as a response to another HTTP request to the indicated API.

The Parameters Section

  • Add Parameter - Adds a new line in the Parameters table, with the GetOrPost type. A new line is not added if the previous line is not filled in.
  • Add Header - Adds a new line in the Parameter table, with the HttpHeader type. A new line is not added if the previous line is not filled in.

Note:

In the case where you want to add multiple values for a header, they must be concatenated through a comma (,).

  • Add URL Segment - Adds a new line in the Parameters table, with the UrlSegment type. A new line is not added if the previous line is not filled in.
  • Delete - Removes a selected line in the Parameters table. If a line is not selected, this button is disabled.

The Parameters Table

  • Name - The name of the parameter, header or URL segment.
  • Value - The value of the parameter, header or URL segment.
  • Type - The type of line. The following options are available:
    • GetOrPost - Indicates that the line is a parameter that can be used in requests.
    • HttpHeader - Indicates that the line added in the Parameters table is a request header to be sent when making the API call.
    • UrlSegment - Indicates that the line added is a fragment or the URL provided in the End point field.
      For example, if you want to perform a GET request for the Robot with the ID 28 in the Community Edition Orchestrator, you should fill in the End point field with https://platform.uipath.com/odata/Robots({id}), the Parameters table should be filled in with one parameter with the id Name, the 28 Value, and the UrlSegment Type.

Important!

In some cases, an error might be returned stating that duplicate parameters cannot exist. These may be caused by authentication requests that need to contain the Password and Username parameters. In these cases, we recommend passing them using the Body property.

The Attachments Section

  • Add Attachment - Enables you to add a file to the HTTP request performed, by creating a new line. Enabled only when the Request Method is set to POST or PUT.
  • Delete Attachment - Enables you to delete a previously added line, in the Attachments section.
  • Name - The name of the file you want to attach.
  • File Path - The full path of the file you want to attach.
  • Type - Indicates what type of information you are sending. This field is automatically filled in with Attachment.
    Preview - Enables you to preview the HTTP request you built, and opens the Response tab.

The Response Tab

This tab enables you to preview the request that you want to include in your workflow. It can be accessed by clicking the Preview button in the HTTP Request wizard once you fill in all the fields and configure the request. Alternatively, you can also change the tab in the upper part of the wizard.

This page comprises the following:

  • Request Info - This section displays details about the request that was performed. It displays the request URL, method and status code.
  • Preview Response - Displays the web server's response.
  • Raw Body - Displays the web server's response, in a raw form.
  • Response Info - Displays details about the web server's response. It displays the response status and code, and the content-type header supported.
  • Download Resource - Enables you to download the requested resources to an indicated file.
  • Refresh - Enables you to perform the request again.

Properties

Client CertificateAuthentication

  • ClientCertificate - The full path to the client certificate file on your hard drive. This field supports only strings and String variable.
  • ClientCertificatePassword - The password for the specified client certificate file. This field supports only strings and String variable.

Common

  • Timeout (milliseconds) - Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown. The default value is 6000 milliseconds (6 seconds).
  • ContinueOnError - Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is False. As a result, if the field is blank and an error is thrown, the execution of the project stops. If the value is set to True, the execution of the project continues regardless of any error.

Note:

If this activity is included in Try Catch and the value of the ContinueOnError property is True, no error is caught when the project is executed.

  • DisplayName - The display name of the activity.

Input

  • AcceptFormat - The format in which to receive the web server's response. The following options are supported: ANY - the default value, XML and JSON.
  • EndPoint - The URL to which you want to make the request. Custom segments have to be placed between braces "{}" and defined in the Parameters section. For example, this URL https://platform.uipath.com/odata/Robots(28) can be written as https://platform.uipath.com/odata/Robots{id}, and the value of the id parameter can be provided in the URLSegments window.
  • Method - The request method to be used when calling the API. The following HTTP verbs are supported: GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH and MERGE. By default, the GET method is selected.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

OAuth1

  • ConsumerKey - The consumer key to be used if the API you are making requests to is based on the OAuth1 authentication protocol.
  • ConsumerSecret - The consumer secret to be used if the API you are making requests to is based on the OAuth1 authentication protocol.
  • OAuth1Token - The access token to be used if the API you are making requests to is based on the OAuth1 authentication protocol, after an authorization request for the consumer has been approved.
  • OAuth1TokenSecret - The secret to be used if the API you are making requests to is based on the OAuth1 authentication protocol, after an authorization request for the consumer has been approved.

OAuth2

  • OAuth2Token - The access token to be used if the API you are making requests to is based on the OAuth2 authentication protocol. This access token is usually generated as a response to another HTTP request to the indicated API.

Options

  • Attachments - Enables you to attach files to requests. Click the Ellipsis button to open the Attachments window and add all the required files.
  • Body - The body of the request.
  • BodyFormat - The format in which the body has to be. By default, it is filled in with application/xml. This field supports strings and string variables.
  • Cookies - The cookies in the HTTP Request. Click the Ellipsis button to open the Cookies window.
  • Headers - Enables you to include custom headers in the HTTP request. Click the Ellipsis button to open the Headers window.
  • Parameters - The request parameters. Click the Ellipsis button to open the Parameters window, which corresponds to the Parameters section.
  • ResourcePath - A file path at which the response should be saved. This field supports strings and string variables.
  • UrlSegments - Custom segments added to the Endpoint URL between braces "{}". Click the Ellipsis button to open the URLSegments window. For example, the https://platform.uipath.com/odata/Robots(28) URL can be written as https://platform.uipath.com/odata/Robots{id}, and the value of the id parameter can be provided in the URLSegments window. This field supports strings and string variables.

Output

  • Result - The response received from the HTTP request, as a string variable.
  • StatusCode - The status code received from the HTTP request, as an integer variable.

Simple Authentication

  • Username - Indicates that the web service uses simple authentication and enables you to input your username. Adding a password is also required. This property supports strings and string variables.
  • Password - Indicates that the web service uses simple authentication and enables you to input your password. Adding a username is also required. This property supports strings and string variables.

HTTP Request


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.