Data web operations

This category contains all operations related to Web API functionality.

HTTP request

Initiates a generic HTTP request with specified parameters, parses the result if necessary and saves it in Bot agent’s memory. This operation can be used to access third-party web APIs (e.g. Telegram, Line, Twitter, REST API, CMMS API, etc). This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Method String HTTP method used by the HTTP request message. This property supports usage of internal bot variables.
Url String Uri address used for the HTTP request. This property supports usage of internal bot variables.
Query parameters Set List of query parameters and corresponding values for the HTTP request. Both key and value properties support usage of internal bot variables.
Headers Set List of HTTP request headers. Both key and value properties support usage of internal bot variables.
Body type Enum

Contents of the HTTP message. The following values are available.

  • None – HTTP message without content

  • x-www-form-urlencoded – HTTP content of name/value tuples encoded using application/x-www-form-urlencoded MIME type

  • Raw – HTTP content based on a string.

  • Binary – HTTP content based on a byte array (typically a file).

  • File – HTTP content containing a file. Received files are downloaded to <projectFolder>/MsgData/Bots/Downloads.

  • Image – HTTP content containing an image. Received files are downloaded to <projectFolder>/MsgData/Bots/Downloads.

  • JSON – HTTP content with a JSON format. The request’s Content Type is automatically changed to application/json.

Body (x-www-form-urlencoded) Set List of name/value tuples for the HTTP message content. Both key and value properties support usage of internal bot variables. This property is only available for “www-form-urlencoded” body type.
Body (Raw) String String used as the HTTP message content. This property supports usage of internal bot variables. This property is only available for “Raw” body type.
File path (Binary) String Path to the input file to send as the HTTP message content. This property supports usage of internal bot variables. This property is only available for “Binary” body type.
Response status key String Unique reference in memory to the status of the HTTP response. This property supports usage of internal bot variables.
Result type Enum

Specifies a format of the HTTP response. The following values are available.

  • None – HTTP response is ignored

  • String – HTTP response stream is decoded to a string

  • JSON parsed object – HTTP response stream is decoded to a string and then de-serialized to a JSON dynamic object. Fields of this JSON object could then be read directly from the internal bot variable, e.g. {resultKeyVar}.access_token

Result key String Unique reference to the HTTP response in memory. This property supports usage of internal bot variables. This property is only available when the Result type is not “None”.
Scope Enum

Accessibility scope of HTTP response in memory specified by the “Result Key” reference. The following values are available.

  • Private – value is available only for the current bot

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Publish

Publish operation – Provides access to a specific file via the Messaging Web Service.

Property name Type Description

Description

String

Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.

File path

String

Full Uri path to the file for sharing. This property supports usage of internal bot variables. The specified path is relative to the directory: <projectFolder>\MsgData\Bots.

Overwrite file

Boolean

True to always replace the destination file. False to skip already published files.

Web server hostname

String

Hostname of the Web server where the Messaging Web service is deployed.

Retention period

Interval

Interval for storing the file. After the specified time the access to the file is automatically removed. This property supports use of internal bot variables.

Protect file

Boolean

True to encrypt the file contents. False to copy the file unchanged. An encrypted file is automatically decrypted before returning it to the client.

Key for Url

String

Unique reference in memory to the Url to get the file. This property supports usage of internal bot variables. The returned Url contains a secret code required to access the file.

Unpublish

Unpublish operation – Removes a file from the list of accessible files.

Property name Type Description

Description

String

Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.

File path

String

Name of the file to be unpublished. This property supports usage of internal bot variables.

Url

String

Url used to access the file. This property supports usage of internal bot variables.