Skip to main content
Version: v5.1

JS Fetch connector

Overview#

The JS Fetch connector provides a simple wrapper for the JavaScript Fetch API.

Note: For more information on this API, refer to Fetch API.

How to use the JS Fetch connector#

To use the JS Fetch connector, pass an object with the parameters you require, from the schema table listed below. Also refer to the code sample listed below.

JS fetch connector schema#

PropertyTypeDescriptionRequired
_orchcompStringEnter “fetch_connector”.Required
_nameStringEnter a descriptive name for what the component does in the orchestrator.Optional
_sequencenoIntegerEnter a number that defines the task’s order in the sequence of tasks to execute.Required
_actualparamsObjectPass an object that contains formal parameters or alternative parameters you want to add as key-value pairs, such as “userType”: “<your-user-type>”.Optional
_actualparams.urlStringTakes the API endpoint URL as a string.Required
_actualparams.argsObjectTakes the options object that can contain parameters, such as “method”, “headers”, “body” and “credentials”.Optional
_actualparams.toStringEMPTYOptional

Code example#

Refer to the sample code below.

{  "_orchcomp": "fetch_connector",   "_name": "Performs GET request for data",   "_sequenceno": 1,   "url": "<your-endpoint-url>",  "_actualparams": {     "args": {       "method": "GET"    }  }  },