Developers

GenerateSession

Usage

Use this method to obtain a sessionToken. Use this sessionToken to start a session and track atomic actions within this session.

client.generateSession().then(function(response){
    //...
});

To start a session see method setSessionData.

Mandatory parameters

This method does not have any mandatory parameters.

Options

This method does not have any options.

Response data format

This method calls the Knowledge API’s POST /inbtrck/session endpoint. Please refer to the Responses section of that endpoint on the Knowledge API Routes page for the response format.

Example

The following example will start a session after generating a sessionToken:

    var sessionToken = "";
    var sessionId = "";
    client.generateSession().then(function(response){
      sessionToken = response.data.sessionToken;
      sessionId = response.data.sessionId;
      client.setSessionData({sessionToken, sessionId});
  });