Overview
Script task to call a web API endpoint.
Setup
The script has the following parameters:
- RestConnection - optional REST connection for specifying authentication method, base URL, proxy and other settings.
- Method - the request method. Can be
GET
,POST
,PUT
,DELETE
,HEAD
,OPTIONS
orPATCH
. - Url - the request URL. Required. Can be relative when RestConnection is specified.
- Cookies - the request cookies. Optional. Syntax is
[name]=[value]
. Each item is on a new line. Alternatively, aCookie
header can be specified directly in the Headers parameter. - Headers - the request headers. Optional. Syntax is
[name]:[value]
. Multiple headers are separated with a newline. - Query - the request query string parameters. Optional. Syntax is
[name]=[value]
. Multiple query string parameters are separated with newline. - Parameters - the request body parameters. Optional. Syntax is
[name]=[value]
. Multiple body parameters are separated with newline. When used the headerContent-Type
becomesapplication/x-www-form-urlencoded
. - ContentType - the Media type of the body of the request. For example:
text/html
,application/json
,application/xml
, etc . - Body - the request body. Optional. Can be JSON, XML, plain text.
- Files - files to upload. Optional.
- Transform - the transformation function to be applied to the response. By default it returns the response unchanged.
underscore.js
functions are available by default. - ResultVariable - the package variable where to store the transformed result.
Parameterizing via SSIS variables
Most of the parameters ( Url, Cookies, Headers, Query, Parameters, Body, Transform ) support variable references. During runtime, all references to SSIS variables are substituted with their corresponding values.
Example: /@[User::SubAccount]/response/@[User::Mailing_Id]/optouts"
. The @[User::SubAccount]
is a variable reference. During runtime, this reference is replaced with the value of a variable called "User::SubAccount".
Configuration
To use this script, you would need to load it in COZYROC JavaScript Task. You can download the JavaScript file and browse to it via the "Import JavaScript code" button.

Ready to give it a try?
COZYROC SSIS+ Components Suite is free for testing in your development environment.