Developers

SessionUser

Usage

Use this method to save the end user's information in the Sessions > Details Dashboard of the Chatbot instance.

Mandatory parameters

This method uses the information stored for the user_info variable.

Optional parameters

Name Type Description
inbenta_extra_field1 string Additional user info by which to filter the results returned in the Reporting API's session_details aggregate
inbenta_extra_field2 string Additional user info by which to filter the results returned in the Reporting API's session_details aggregate
inbenta_extra_field3 string Additional user info by which to filter the results returned in the Reporting API's session_details aggregate

Response data format

This method calls the Chatbot API’s POST /inbtrck/session/user endpoint. It returns a Promise with the API response data. Please refer to the Responses section of the endpoint on the Chatbot API Routes page for the response format.

Example

var user_info = {
  browserInfo: navigator.userAgent
}
chatbot.api.sessionUser(user_info);

The following example includes the additional optional parameters:

var user_info = {
  inbenta_extra_field1: 'Inbenta',
  inbenta_extra_field2: 'Barcelona',
  inbenta_extra_field3: 'Developer'
}
chatbot.api.sessionUser(user_info);