Other Methods

Other Methods

πŸ“˜

Info

Remember to use it after chat was loaded and ready method is already running.

A message from an operator

Send a new chat message from a given operator. With this method you are able to send a different automatic message on each page of your website upon your request.

tidioChatApi.messageFromOperator('Message from operator!');

A message from a visitor

This method sends a message from the visitor to the operator. This can be used when a visitor clicks on a button on the page. It will then activate a conversation about a certain issue they need help with.

tidioChatApi.messageFromVisitor('Message from visitor!');

Popup open

Opens the chat window. The effect is the same as if a user would click the chat window on your page. If the pre-chat survey is enabled, the visitor will need to fill out the fields before the message sends.

tidioChatApi.open();

Popup close

This closes the chat window. The effect is the same as when a visitor clicks the hide icon at the top of the chat window.

tidioChatApi.close();

πŸ“˜

Info

NOTE: open and close methods will also trigger coresponding events. Avoid using them in listeners for those events to prevent loops in code.

❌ Don't:

window.tidioChatApi.on('close', function () {
    window.tidioChatApi.close();
});

Chat display

This will either show or hide the chat window, depending on the setting of the argument. The method is executed asynchronously if it is called upon before loading the chat. When the 'show/hide' function will be called, but before the chat is loaded, then the loading will be postponed until the function with the attribute "true" is ran.

tidioChatApi.display(true);

Alternatively you can use hide and show methods.

tidioChatApi.hide();
//or
tidioChatApi.show();

πŸ“˜

Info

NOTE: Hiding the chat window through tidioChatApi does not block triggering chatbots.

Set Chat Color

By using this, you are able to change the colour of the chat. For example, you can adjust the scheme to appear in a unique fashion on each subpage or even set them to appear differently throughout the day or mood.

tidioChatApi.setColorPalette('#333333');