SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - HTTP Request

Collection of functions related to HTTP requests for retrieving information from web sites or web services.

Activities

Get DNS Information

Get Information about DNS


Technical Name Type Minimal Agent Version
getDNSInfos asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
url string mandatory Options

Output Parameters:

Name Type Description
dnsInfos irpa_core.dnsInfos Result.

Errors:

Error Class Package Description
RequestError irpa_core Request error


Get Trace Route

Get Information about DNS


Technical Name Type Minimal Agent Version
getTraceroute asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
url string mandatory URL

Output Parameters:

Name Type Description
traceroute any Result


Call Web Service Deprecated

Create and send an HTTP request to call a remote service (API call for instance). A query can be supplied and the result can be parsed as JSON string. A file download may happen for some calls. This is only for non SAP integrations, for SAP integration please use Call SAP Web Service.


Status From Substitute Activity
Deprecated 1.75 irpa_core.request.restCall

Comment:

This activity may behave differently when a proxy is used compared to when it is not. Please use 'Rest Call Web Service With Destination' activity instead.



Technical Name Type Minimal Agent Version
call asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
options any mandatory Options.

Output Parameters:

Name Type Description
obj any Result.

Sample Code:

const param = { id: 2172797, APPID: 'e5c5290b3475c43a8d66d138c319a400' } const options = { url: 'http://api.openweathermap.org/data/2.5/weather', searchParams: param, responseType: 'json', resolveBodyOnly: true, //This parameter allows you to send an SAP password within the header if needed. usePassport: false, //This parameter allows you to send a WIN CA certificate within the https. useWinCa: false, //This parameter allows you to send a file encoded as buffer within the body. readFileAsBufferToBody: '' }; const res = await irpa_core.request.call(options);

Errors:

Error Class Package Description
RequestError irpa_core Request error


Rest Call Web Service

Create and send an HTTP request to call a remote service (API call for instance). A query can be supplied and the result can be parsed as JSON string. A file download may happen for some calls. This is only for non SAP integrations, for SAP integration please use Call SAP Web Service.


Technical Name Type Minimal Agent Version
restCall asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
options any mandatory Options.

Output Parameters:

Name Type Description
obj any Result.

Sample Code:

const param = { id: 2172797, APPID: 'e5c5290b3475c43a8d66d138c319a400' } const options = { url: 'http://api.openweathermap.org/data/2.5/weather', searchParams: param, responseType: 'json', resolveBodyOnly: true, //This parameter allows you to send an SAP password within the header if needed. usePassport: false, //This parameter allows you to send a WIN CA certificate within the https. useWinCa: false, //This parameter allows you to send a file encoded as buffer within the body. readFileAsBufferToBody: '' }; const res = await irpa_core.request.restCall(options);

Errors:

Error Class Package Description
RequestError irpa_core Request error


Call SAP Web Service

Create an send an HTTP request to an SAP server (API call for instance) passing the SAP Passport to be license compliant.


Technical Name Type Minimal Agent Version
callSAP asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
options any mandatory Call options.

Output Parameters:

Name Type Description
obj any Options.

Sample Code:

const options = { url: 'https://api.sap.com/S4HANAOPAP/..', responseType: 'json', resolveBodyOnly: true }; const res = await irpa_core.request.call(options);



Call Web Service with Destination Deprecated

Create and send an HTTP request to call a remote service (API call for instance) represented through a destination.


Status From Substitute Activity
Deprecated 1.75 irpa_core.request.restCallWebServiceWithDestination

Comment:

This activity may behave differently when a proxy is used compared to when it is not. Please use 'Rest Call Web Service With Destination' activity instead.



Technical Name Type Minimal Agent Version
callWebServiceWithDestination asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
destination any mandatory Destination to use when executing the request.
options any mandatory Call options. Note that the URL property has to be a path for this activity. This path will be combined with the URL defined in the destination.

Output Parameters:

Name Type Description
obj any Response.


Rest Call Web Service with Destination

Create and send an HTTP request to call a remote service (API call for instance) represented through a destination.


Technical Name Type Minimal Agent Version
restCallWebServiceWithDestination asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
destination any mandatory Destination to use when executing the request.
options any mandatory Call options. Note that the URL property has to be a path for this activity. This path will be combined with the URL defined in the destination.

Output Parameters:

Name Type Description
obj any Response.


Download File

Download a file from a location to a specified location (local) using an HTTP/HTTPS request.


Technical Name Type Minimal Agent Version
download asynchronous WIN-3.24, MAC-3.24, CLOUD-3.34

Input Parameters:

Name Type Attributes Default Description
url string mandatory URL.
destination string mandatory File path destination.
timeout number optional Timeout in millisecond. The default value is 30000 ms.
options any optional Options.

Sample Code:

await irpa_core.request.download('https://theSite.com/wp-content/uploads/picture02.jpg', 'c:\\...\\picture02.jpg')

Errors:

Error Class Package Description
InvalidArgument irpa_core Destination must to be a file path.
RequestError irpa_core Request error