Search code examples
smooch

Getting 403 error on init call for web messenger from smooch.io


Web messenger stopped working pre Version 4, changed init, see below:

Smooch.init({
    appId : '<my appID>',
    embedded: true
}).then(() => {
    Smooch.sendMessage("Hello Bank Assist")
    Smooch.render(document.getElementById('watson'))
});

and getting http error 403, any ideas?


Solution

  • Version 3 of the Web Messenger was deprecated in Summer 2017, and support was officially discontinued in early July 2018. You'll need to update to a version > 4.0.0 in order to keep using your integration. Installation instructions can be found in the documentation. See the v4.0.0 release notes for notable changes when switching from the 3.x version series.

    There was a change to embedded mode that you'll need to account for in your init code. In embedded mode, you now need to call render in order for the init logic to start, so your code should look like this instead:

    Smooch.init({
        appId : '<my appID>',
        embedded: true
    }).then(() => {
        Smooch.sendMessage("Hello Bank Assist");
    });
    Smooch.render(document.getElementById('watson'));