Initializing a message from a client and widget methods
Initializing a message from a client
Method for sending messages to the widget with its opening-creating a chat: window.usedeskMessenger.sendMessage
The method accepts parameters
message | Required parameter. The text that will be sent to the widget on behalf of the current client |
name | Client's name |
Client's email |
|
phone | Client's phone |
token | Required parameter. A signature that uniquely identifies the user and his chat on any device to save the history of correspondence (our system generates it, a limit at least 64 characters). To get a chat token to use the userIdentify() method, run the window.usedeskMessenger.getChatToken() command |
If you require to fill email before opening chat, the system will wait until the chat window opens and immediately send a message.
Request example
window.usedeskMessenger.sendMessage({message:"Any text"})