Desenvolvedor Javascript API

Temos uma API Javascript e um CSS personalizado simples e poderoso que lhe dá ampla flexibilidade sobre como seu aplicativo se comporta.

Desenvolvendo com Social Intents

Give it a shot! All you need to do is ensure you have the Social Intents generated code snippet or plugin installed on your page. Once you have that, you can use any of the methods defined below.

onSIApiReady()

This callback method is used to notify your page when the Social Intents API script has finished loading. Since we load our scripts asynchronously, you can wrap your initialization logic in this method

    <script type="text/javascript">
    function onSIApiReady() 
    {
    //Will display the tab once the scripts have loaded
    SI_API.showTab();
    };
    </script>

SI_API.showInvite(message)

This method is used to display the proactive chat invite with a custom message. Use this to create custom invite messages for each page of your site. It's a great way to increase conversions.

    <script type="text/javascript">
    function onSIApiReady() 
    {
    //Will display the tab once the scripts have loaded
    SI_API.showInvite('Questions about our products? I can help!');
    };
    </script>

SI_API.setChatInfo(name,email,phone,group,question)

This method is used to prepopulate pre-sales chat info. For instance, if you a member site and have already collected email and name, you can pre-populate these fields on the chat. If you don't want the visitor to change them, simply disable these fields in your settings, and we'll automatically place this information in the chat.

    <script type="text/javascript">
    function onSIApiReady() 
    {
    //Will display the tab once the scripts have loaded
    SI_API.setChatInfo('visitor name','email@test.com','(123) 123-1234',
    'Marketing','I have a question about your products');
    };
    </script>

SI_API.showPopup()

This method is used to display the chat window or popup on your page. Have more complex rules on how you want to display your app? Here's where you can do it.

    <script type="text/javascript">
    SI_API.showPopup();
    </script>

SI_API.hidePopup()

This method is used to hide the popup on your page. Want to automatically close the popup after a period of time, here's your method.

    <script type="text/javascript">
    SI_API.hidePopup();
    </script>

SI_API.showTab()

This method is used to show the Tab button on your page. For example, you can display it after a custom period of time, or after a click on a certain element on your page.

    <script type="text/javascript">
    function onSIApiReady() 
    {
    //Will display the tab once the scripts have loaded
    SI_API.showTab();
    };
    </script>

SI_API.hideTab()

Este método é usado para ocultar o botão Tab em sua página.

    <script type="text/javascript">
    SI_API.hideTab();
    </script>

SI_API.addParams()

Adicione parâmetros personalizados a cada solicitação de bate-papo para exibir no convite. Envie informações do cliente, números de pedidos ou quaisquer outros detalhes.

    <script type="text/javascript">
    function onSIApiReady() 
    {
        var params = [];
        params.push({name:'Member ID',value:'abc'}); 
        params.push({name:'Order Number',value:'1000'}); 

        SI_API.addParams(params);

    };
    </script>

SI_API.onChatOpened()

Este método de chamada de retorno é acionado quando o botão de bate-papo é clicado e a janela de bate-papo aparece.

    <script type="text/javascript">
    function onSIApiReady() 
    {
        //Will trigger when chat window appears
        SI_API.onChatOpened = function()
        {
            alert("chat opened");
        };
    };
    </script>

SI_API.onChatChatClosed()

Este método de chamada de retorno é acionado quando a janela de bate-papo é minimizada.

    <script type="text/javascript">
    function onSIApiReady() 
    {
        //Will trigger when chat window is minimized
        SI_API.onChatClosed = function()
        {
            alert("chat closed");
        };
    };
    </script>

SI_API.onChatEnded()

Este método de chamada de retorno é acionado quando uma conversa ativa é encerrada.

    <script type="text/javascript">
    function onSIApiReady() 
    {
        //Will trigger when chat window is minimized
        SI_API.onChatEnded = function()
        {
            alert("chat ended");
        };
    };
    </script>