Flexmonster Software License Agreement (“Agreement”) has been significantly revised and is effective as of September 30, 2024.
The following modifications were made:
The modified version of Flexmonster Software License Agreement is available here.
Downloading, installing, and/or continuing to use Flexmonster Software after September 30, 2024, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Flexmonster Software License Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license under License Model or Maintenance after the effective date of any modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
customizeAPIRequest(customizeAPIRequestFunction: Function)
[starting from version: 2.8]
This API call allows customizing the request before it is sent to a server. Only for "api"
data source type.
customizeAPIRequest
can be defined in two ways:
pivot.customizeAPIRequest(customizeAPIRequestFunction)
.new Flexmonster({customizeAPIRequest: customizeAPIRequestFunction, ...})
.The customizeAPIRequestFunction
function, which has the following signature: customizeAPIRequestFunction(requestBody: Object): Object
. Data passed to customizeAPIRequestFunction
:
Parameter/Type | Description |
---|---|
requestBody Object | The object containing the request's body and through which the request can be customized. |
requestBody.requestHeaders Object | Allows you to add custom request headers. This object consists of "key": "value" pairs, where "key" is a header's name and "value" is its value. The requestHeaders object is either empty or contains the request headers added in report.dataSource.requestHeaders.After customization, Flexmonster adds the contents of requestHeaders to the headers of the request. Changes made in requestBody are added to the request's body. |
The customizeAPIRequestFunction
function must return requestBody
, the changed object with new or updated request headers. If requestBody
is null
, custom request headers will not be added to the request.
If the customizeAPIRequestFunction
is set to null
, no customization is applied.
Adding custom request headers:
function customizeAPIRequestFunction(req) { req.requestHeaders = { "customHeader1": "This is the first custom request header", "customHeader2": "This is the second custom request header" }; console.log(req); return req; }
Check out a live sample on JSFiddle.