Server scripts
Go to Content > Knowledge > Advanced > Server scripts
Here you can add javascript functions that can be used when configuring a knowledge, as for example.
In server scripts, you can add elements to retrieve information from the server: getHostType, getHostName, getServerType.
Console
The console object is used to feed the logs present in the BMS console page for the different log levels
CallApi
To trigger the call to an API from a server script, you must use the following syntax.
For the moment this needs to be framed in a JSON.parse(), but this will no longer be necessary later.
with apiName containing the name of the defined web service and params containing a JSON object containing a mapping between the keys used by the web service and the values to use. Example params below :
Capture
The server script can read variables from the current conversation via the capture object. For example to know the caller's number for the callbot this can be done as in the example below:
Dialog
The dialog object will eventually allow more information to be retrieved, but for the moment it allows you to retrieve the name of the consultation space currently used in the conversation
Last updated