Need a special offer?Find out if your project fits.
All documentation
API reference
  • 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/Type Description
    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.


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

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

    See also