HTTP REST Request
Last updated
Last updated
This action executes a synchronous REST call.
URL: The given URL, or variable defined as the specific URL for the target webpage.
Method:
GET
POST
Timeout: number of milliseconds to wait before aborting the request.
Request Headers: The metadata attached to the API call.
Request Body: The body of the request.
Request Parameters.
Note: The body is disabled for the GET request.
Username: The Username used for the request.
Password: The password used for the request.
Output: set an already defined variable as output, or define a new one.
Response Code: set already defined variables as a response code, or define a new one.
Persist Session: Specifies if the cookies generated during the call will be saved as persistance data for the duration of the automation or discarded. It can be set to True or False.
Display Name: action display name in your implementation project
Wait Before: number milliseconds robot to wait before executing the action.
Wait After: number milliseconds robot to wait until moving to the next action.
Abort on Error: True/False
Retry Times: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.
Get the RON - EUR exchange rate from the Romanian National Bank.
Get customer support metrics from the ITSM tool
Get the current price of a certain cryptocurrency
Example
In this example, the robot will access the API of coindesk.com and retrieve the price of bitcoin in EUR.
Steps:
Create a new project
Create a new Sequence and rename it.
Add a new activity HTTP Rest Request in the newly created Sequence and edit the following parameters:
URL: "https://api.coindesk.com/v1/bpi/currentprice.json"
Method: GET
Watch the robot in action:
Output: a string variable (e.g. outputREST)
Response Code: an int32 variable (e.g. responseCode)
Add a new activity JSON Deserialization in the same Sequence and edit the following parameters:
Content: the same string variable (e.g. outputREST)
Output: a JObject variable (e.g. rate)
Add a Write to Console activity having as output:
, where rate["bpi"]["EUR"]["rate"] is the JSON hierarchy.
Watch the robot in action:
You can see how the HTTP REST Request activity is used in an example that incorporates multiple activities. You can check and download the example from here:
Doesn't fully answer your question, or you want to find out more? Ask your question in the comments, on our community forum, or contact our support team or your account manager. Whatever works for you, your question will find its answer soon!