Call REST Service

Call REST Icon

Call Rest Service:
This workflow task enables Administrators to call an external web services from an automatic workflow task without coding.

General Settings
More information on general workflow task settings can be found here:
Workflow Tasks

Edit
Opens a dialog that lets you configure the REST call settings.

Icon Description
New Request Icon

Add a new REST call.

Edit Request Icon

Edit a rest request.

Delete Request Icon

Delete a REST request.

Move Up Icon

Move the REST request up in the list. By default, the calls are executed top to bottom.

Move Down Icon

Move the REST request down in the list.

Name:
Add a name for the REST call.

Scripting ID
Add a scripting ID for the REST call.

Credential
Select a saved credential from the central credential store to authenticate against the provider of the endpoint the call is made to.
Credentials

Verb
Select the HTTP request method from the drop-down menu.

Drop-down menu options

Request Function

GET

Retrieves data from a server at the specified resource.

POST

Sends data to the API server to create or update a resource.

PUT

Sends data to the API to update or create a resource. The difference is that PUT requests will always produce the same result.

DELETE

Deletes the resource at the specified resource.

PATCH

Similar to POST and PUT options, but only applies to partial modifications to the resource.

URL Field
The placeholder for the URL of the Web Service call.

Macros
Opens a dialog with all available macros.

Script
An initialization script can be created, which will be executed before the execution of the field assignments. Also, variables and functions could be defined here that will be available for the assignment scripts.

Test
Runs a test API call that checks whether a communication can be made to the Web Service and if a response can be achieved. Opens a dialog to demonstrate the outcome of the test.

Parameters
List the parameters required to send and receive.

Add
Add a Parameter.

Remove
Remove a Parameter.

Header
List the Headers required to send or receive.

Document
If a document should be sent to a 3rd party service via the REST call, configure the content and sending method.

Body
List the JSON Values and Objects.

Insert
Select either a JSON Object or Value to be listed.

Remove
Remove a JSON Object/ Value.

Load JSON request
Upload a JSON file into the Body. The JSON can either be added from a file on your device or directly from your clipboard.

Response
Define the response that should be received from the 3rd party service.

Success codes
List the success codes that the API call should consider to be successful.

Script
An initialization script can be created, which will be executed before the execution of the field assignments. Also, variables and functions could be defined here that will be available for the assignment scripts.

Load JSON response
Upload a JSON file into the Body. The JSON response can either be loaded from a file on your device or directly added from your clipboard.

Info Icon

Note:

  • REST calls were designed for making outgoing calls to third-party applications. Although it’s possible to use REST calls to call the Therefore API, to solve advanced requirements, the feature is limited especially when working with index data information.

  • In order for third-party applications to access Therefore™ while bypassing two-factor authentication, they will require a Service Account. Please see our reference below for more information:
    Users and Groups

Scripting - Objects and Functions

Type of Object Name Description Used with
REST Call Status Code Returns the current status code. Script
GetResponseHeader    
NextRequest    
ExecCounter    
ExitSuccess    
ScriptError    
Index Data Object SetField Sets the value of the index data field. Script
GetField Gets the current index data value of the specified field Script
GetFieldEx Gets the current index data value of the specified field without applying backwards compatible conversions. Script
SetCategory Gets the category for the current document. You can use an integer (category ID) or a string (category name). Script
SetCaseNo Sets the CaseNo for this Index Data object. Script
GetCategoryName Gets the category name to which the index data object belongs to. Script
GetTableValue Gets the current index data value of the specified field from the specified row. Script
SetTableValue Sets the value of the index data table field in the specified row. Script
Workflow Object AssignedToUserDisplayName Returns the user display name to whom the task is assigned. Script
AssignedToUserName Returns the username to whom the task is assigned. Script
InitiatorDisplayName Returns the display name of the workflow initiator. Script
InitiatorEmail Returns the email address of the workflow initiator. Script
InitiatorName Returns the username of the workflow initiator. Script
InstanceNo Returns the instance number for this workflow. Script
MainDocNo Returns the document number of the main document for this workflow. Script
PreviousTaskUserDisplayName Returns the user display name of the user who completed the previous task. Script
PreviousTaskUserEmail Returns the email address of the user who completed the previous task. Script
PreviousTaskUserDomain Returns the domain of the user who completed the previous task. Script
PreviousTaskUserName Returns the username of the user who completed the previous task. Script
ProcessDueDateTime Returns the workflow process due date and time. Script
ProcessDueDate Returns the workflow process due date. Script
ProcessName Returns the workflow process name. Script
ProcessStartDate Returns the workflow process start date. Script
ProcessStartDateTime Returns the workflow process start date and time. Script
ServerName Returns the computer name on which the workflow task is running. Script
TaskDueDate Returns the task due date. Script
TaskDueDateTime Returns the task due date and time. Script
TaskNameTo Returns the next task name. Script
TaskStartDate Returns the task start date. Script
TaskStartDateTime Returns the task start date and time. Script
UserDisplayName Returns the workflow user display name. Script
UserDomain Returns the workflow user's domain name. Script
UserEmail Returns the workflow user's email address. Script
UserName Returns the workflow user's username. Script
WebClientDocLink Returns a link to the main document of the workflow. Script
WebClientLink Returns a link to the Therefore™ document of the workflow. Script
WebPortalDocLink Returns a link to the main document of the workflow in the portal Script
CaseNo Returns the case number for a case workflow. Script
TenantName Returns the name of the tenant. Script
EFormLink Returns the root link to the Therefore™ eForms. Script
WebClientLinkDynamicView Returns a link to the workflow instance in the newer Therefore™ Web Client. Script
WebClientDocLinkDynamicView Returns a link to the main document of the workflow instance in the newer Therefore™ Web Client. Script
CategoryNo Returns the number of the category in which the workflow is being executed in. Script
CaseDefNo Returns the number of the case definition in which the workflow is being executed in. Script
eSignatureDocID Returns the last document ID issued by this eSignature provider. Script
InitiatorDomain Returns the domain name of the workflow initiator. Script
TokenNo Returns the token number of the workflow instance. Script
AddCommentToWorkflow Adds a comment to the workflow instance. Script
GetAccessToken Generates an Access Token to open the workflow instance or main document or case using the WebAPI. The expected life time can be set in minutes. The maximum life time is 60 minutes. Script
GetDocumentText

Retrieves the raw text content of a document.

Supports an additional parameter - StreamNo:
Default value is 0, which returns the text of all streams.
If a specific stream number is specified only the raw text from that stream is returned. This function cannot do OCR.

Script
Helpers ToDate Converts a string in the specified format to a date, using 'D', 'M' and 'Y' for day, month and year respectively.
Delimiters are interpreted strictly.
Script
ToFloat Converts a string in the specified format into a float number. Script
ToDecimal Converts a string in the specified format into a decimal number. Script
ToDateTime Converts a string a Datetime using the specified LCID. Script
DecimalAdd Adds two decimal numbers. (decimal1 + decimal2) Script
DecimalSub Subtracts two decimal numbers. (decimal1 - decimal2) Script
DecimalMul Multiplies two decimal numbers. (decimal1 * decimal2) Script
DecimalDiv Divides two decimal numbers. (decimal1 / decimal2) Script
DecimalCmp Compares two decimal numbers.
Returns 0 if they are equal.
Returns -1 if decimalLeft is lesser than decimalRight.
Returns 1 if decimalLeft is greater than decimalRight.
Script
AdjustClientTimeDifference Returns the 'Time difference of clients' server setting. This value can be added to an existing Datetime value to calculate the client timezone. Script
Date Returns today's date. Script
GetSystemVariable Returns the value of the specified system variable. Script