All documentation
  • API Reference for older versions
  • unauthorizederror

    [starting from version: 2.8.17]

    It is triggered when the Accelerator or the custom data source API server sends the 401 Unauthorized error in response to Flexmonster's request. Only for "api" and "microsoft analysis services" data source types.

    Data passed to the handler

    Parameter/TypeDescription
    callbackHandler
    Function
    It can be used to resend the request to the Accelerator or to the custom data source API server. callbackHandler accepts an Object that can have the following parameters:
    • requestsHeaders - Object. New request headers can be specified here.

    Example

    unauthorizederror can be used to automatically refresh authorization headers and resend the request in case of the 401 Unauthorized error:

    pivot.on('unauthorizederror', function (callbackHandler) {
     // other actions
     // pass new request headers and resend the request
     callbackHandler({
       requestHeaders: {
         AuthToken: "XXX"
       }
    });
    });

    See also

    olapstructureerror
    queryerror
    dataerror