Service/API thinklet

The Service/API thinklet supports the following connector credential types:

Basic

Bearer

OAuth 2.0 - Client Credentials

OAuth 2.0 - Authorization Code

No Auth

The Service/API thinklet makes a REST call to an external public API. Use it to retrieve additional information or request actions to be performed.

The Service/API thinklet supports the following call methods:

  • GET

  • POST

  • PATCH

  • PUT

  • DELETE

The supported payload and response for the Service/API Thinklet are in JSON format.

  • Name: Enter a unique name for the Service/API thinklet.

  • ID: The system generates the ID automatically based on the name.

  • Description (optional): Describe the purpose of the thinklet and what it does. This information is useful for other users of the workflow who may not be familiar with it.

  • Credentials: Select the connection credentials for the integration. You must configure them first on the Connector credentials page of the Administration module. Refer to the Connector credentials documentation for more information.

  • Request Method: Select the request connection method.

  • Resource: Enter the endpoint for the connection.

  • Add custom header: Add up to 5 custom headers to pass additional metadata if required. You must add authorization headers in Credentials instead

  • Payload: Enter the JSON payload that will be sent to the external system.

Collecting data from API calls

The Service/API thinklet can read data from the response received from a call made to an external system.

It supports up to 5 outputs.

When waiting for a response, the Service\API thinklet waits up to 10 seconds for a response from the external system, after which the call is considered as having failed.

When a response is received the total size of the response received from the external system must not exceed 2 MB of data regardless of whether any outputs are configured.

To configure these outputs:

  • Click Add output.

  • Name: Enter a name to use as a reference in conditions and thinklet inputs.

  • JSON path: Use JSONPath for the data that the system expects to receive. This path should always be prefixed with $. followed by the path to the data delimited by a period.

  • Key elements how to extract values from JSON :

    • Root element: $

    • Access a key: $.key

    • Access nested element: $.parent.child

    • First array element: $.array[0]

    • Enclose special keys in single quotes: $['@key'], $['key.with.dots']

Tip: Utilize the online converter tool to parse JSONPath during testing.

Example of capturing the incident number from ServiceNow:

$.result.number

Example of capturing the "displayName" element of an array of results:

$.value[0].displayName

The maximum size allowed for JSON Path output is 30 KB or 3840 characters.

Using database and workflow values in payloads

Reference the data of users and devices along with data collected during the execution of the workflow in the Resource and Payload fields.

Refer to the Parameters and dynamic values documentation for more details on how to reference dynamic values.

Last updated

Was this helpful?