Client Tokens for Web Chat Channels

Client Tokens for Web Chat Channels

In Mindbehind Web chat channel, we are supporting three types of authentication, either anonymous, or through one-time code coming to the client's mobile phone as a SMS message, or through tokens in case the client already signed in your website and you want them to be directly authenticated when using Mindbehind web chat installed on your website.

The first step to achieve that is to generate a channel management token by navigating to your company profile page, going to the channels tab, and then generating a token for the target Web chat channel like in the screenshot.


Please copy the channel id and management token and keep them in a safe place.

After that, you will need to call our endpoint to generate a token for your client with the following:

  • Endpoint URL: https://app.mindbehind.com/external/v1/incoming/mbWebChat/token
  • HTTP Method: POST
  • Required Header: “apiToken” as the channel management token
  • Body: Should be in JSON format with the following schema:
    • clientID: This is your system client ID. It can be any string. You can also use your client phone number if you want
    • channelID: This is your channel id. You will get that when you are generating the management token
    • tokenAge: This is an optional parameter, it is an integer number that overrides the token age chosen in channel settings or the default token age which is 24 hours.
    • properties: An optional parameter which is a map of additional properties for your user like name, email etc.
  • Result: You will get a JSON payload as next: { success: true, token: <The generate token as string> }

After you get the token you will need to inject the token and your client id to window object in JavaScript before putting the Mindbehind web chat script, like next:

window.MB_TOKEN = "<The generated token>";
window.MB_CLIENT = "<Your client id>";
So after the client opens the web chat widget, he/ she will be automatically be authenticated with our system until the token age finishes.
 

 

 

 

 


    • Related Articles

    • How to assign Key-Value to Client from Mindbehind Live and APIs

      Website (live.mindbehind.com) If the agent has an open live conversation from the right client panel the agent can add, remove a key-value propery of the client by selecting the Profile tab Using Apis: Get Client: Endpoint URL: ...
    • How to use Web Messenger in Native Apps

      ·       All native apps need to use WebView to open a web page that contains the script of the channel. ·       The web page can be done by the customer side by calling the script provided in the channel settings. You can find details in this ...
    • How to Use Human Action

      Action usage Human action is used to handover the conversation to the live agent. The handover configuration is defined for each channel in the channels section when you navigate to your company profile page. So to use this action its enough just to ...
    • How to Send parameters from Mindbehind WebChat to the bot

      Default data (always sent to the bot) We are always sending the 1. BROWSER_TYPE : The type of browser the client has (ex: Microsoft Edge, Mozilla Firefox, Google Chrome) 2. CHAT_URL: The url of the page Parameters in the URL We are checking the url ...
    • How to Use Integration Action

      Action usage Use the integration action when you want to call an HTTP integration endpoint to achieve some custom business needs. You can process the parameters saved during the life cycle of the assistant, and either only store them out in some ...