Rest API
Last updated
Last updated
The REST API Tool enables the Dataworkz Agent to access any system that has a REST API. These could be internal or external systems - with or without authentication. The REST API Tool provides a generic interface to configure an HTTPS REST call.
Many systems such as SaaS applications, and other internal microservices provide access to their functionality via REST API. These systems and API can be made available to the Agent by creating REST API Tools.
Details of the REST API you want to invoke - any authentication requirements (api-keys, tokens, etc), the http method to use, any headers to pass, request payload, query parameters, etc.
To create a REST API Tool, select Create Tool from the Tools Repository and pick Rest API from the options provided.
You will get the REST API Tool Editor -
As with all tools provide a meaningful name and description that will help the agent understand the purpose of this tool so that the agent can use it correctly.
Method: Pick the HTTP Method
Body: Provide a template to use as the body if required. Parameters can be used in the body template
Header: Specify headers - Hit enter after each header: value combination. E.g. Content-type: application/json. Parameters can be used.
JSON Path: If the result needs to be extracted from a part of a JSON response then a JSON Path can be specified here. Currently it does not support parameterization.
Any parameters included in the URL, Body, Headers, etc will be shown as Parameters. Parameters can be input parameters - which means they have to provided during invocation or they can be configuration and provided in this screen. Configuration parameters can be used for things like api-tokens or versions for better management.
The output of the REST API Call should be described here.
As with all tools, the tool can be tested by providing values for the input parameters. The json path is applied and the result is available in the key "result"