Service/API thinklet
Last updated
Last updated
The Service/API thinklet supports the following connector credential types:
Basic
Bearer
OAuth 2.0 - Client Credentials
OAuth 2.0 - Authorization Code
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.
Payload: Enter the JSON payload that will be sent to the external system.
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: Add the JSON path 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. Example of capturing the incident number from ServiceNow:
The maximum size allowed for JSON Path output is 30 KB or 3840 characters.
Reference the data of users
and devices
along with data collected during the execution of the workflow in the Resource and Payload fields.
Include a reference to the data within double braces:
Example of Payload to ServiceNow using a Nexthink database attribute:
System values can be used to provide a reference to the current workflow execution. This is useful in the case where the workflow will need to wait for a 3rd party system to perform some actions and then make a call back to the workflow to allow it to proceed.
System values are always prefixed with sys.workflow
A list of these values is represented below.
sys.workflow.executionId
: Is a reference to the id of the currently running workflow execution
sys.workflow.workflowId
: Is a reference to the specific workflow design which is being executed.
An example of the usage of these values is shown below in the context of an integration with a Moveworks chat bot where these values will be used by the chat bot to move the workflow along later.
Use the following format when referencing outputs from other thinklets in the workflow:
Example of resource for ServiceNow incident update which includes data from a previous Service/API thinklet to log a ticket:
When fetching data attributes, you can collect data from the device and user objects. The objects’ data will be based on the device or user that the workflow execution is currently running against.
The format for accessing this data is the following:
Example of referencing a device attribute:
Example of referencing a user attribute:
For a list of the supported attributes, refer to the device and user sections of the NQL data model using the value contained within the field column as the field name.