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#
| Property | Type | Description | Required |
|---|---|---|---|
_orchcomp | String | Enter “fetch_connector”. | Required |
_name | String | Enter a descriptive name for what the component does in the orchestrator. | Optional |
_sequenceno | Integer | Enter a number that defines the task’s order in the sequence of tasks to execute. | Required |
_actualparams | Object | Pass 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.url | String | Takes the API endpoint URL as a string. | Required |
_actualparams.args | Object | Takes the options object that can contain parameters, such as “method”, “headers”, “body” and “credentials”. | Optional |
_actualparams.to | String | EMPTY | Optional |
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" } } }, …