Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ON THIS PAGE:

Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

You can connect Whatsapp with Motion in two official different ways: Twilio and Sinch via Conversation API, (doing a switch from Whatsapp API to Conversation API, if you already use Whatsapp Connector)

Note

By the end of September 2023 v1 Sinch version will be deprecated as indicate in the official Sinch portal:

[...]“Support for the standalone WhatsApp API will end on September 30, 2023. New customers must use, and existing customers must migrate to, the WhatsApp channel of the Conversation API. Any migration must be completed prior to September 30, 2023..[...] “ (for more information https://developers.sinch.com/docs/whatsapp/migration-guide/overview/)

To continue using Sinch provider you must upgrade Motion to v 3.22.0 and use Sinch v2.

Sinch account

There are two important sections on Sinch:

  • Whatsapp (“old section” for Whatsapp API)

  • Conversation API → new section

On Whatsapp section you can access to Senders, so telephone numbers approved by Meta which can receive and send new interactions. Configure senders is essential for getting Whatsapp working.

Senders can have associated Message Templates, so predefined messages approved by Meta that can be used to start new interactions with customers.

Info

In current implementation, templates are not supported in Conversation API, only incoming chats from Whatsapp where agents reply are supported

How to configure a Whatsapp Channel on Conversation API

  • You need to create a Project: company or partner’s customer

  • Configure app which can be considered like an aggregator of service channels. App can have 1 channel of each type, but 1 telephone number allows only the creation of 1 app.
    If e.g. you need a chat for reservations and a chat for information you have to configure 2 apps, but if you need Telegram and Whatsapp Channels you can use the same app

  • two available regions, USA and EU, depending on customer's number: insert EU if it is an European number or USA if it is an American number

Info

If you have doubts about region, you can ask to Sinch support

  • Clicking on the created app, you can edit it from configuration section, by modifying the name but is not recommended to do that

  • Processing Mode: Conversation mode

Note

It is essential to select this mode to allow Motion to reply to customer messages (without it, client id is not sent with the message, so messages arrive from Sinch to Motion as "Fire and forget" (so only as notification).

  • On Set up channels you can configure app connections
    As reference guide to create another channel, you can use Instagram via conversation API.
    Officially, we support only Whatsapp and Instagram via Conversation API

Whatsapp setup can only be done with Sinch.

You need to ask to your account manager to associate phone number to this app, sending an email to your account manager.
If you already have contacts with Whatsapp API, you can speak with the same account manager, otherwise you can request contact from Overview section → Get Started

In your email for account manager, you have to send your:

  • Sinch App ID: you can copy it from Conversation API→ Apps (Sender identity is the ID approved by Meta)

  • Sinch Project ID: you can copy it from Conversation API→ Overview

How Admin can configure Sinch on Motion

Panel
bgColor#FFEBE6

☑️ Motion instance must be accessible via HTTPS

☑️ Motion instance must have valid certificate


Create a Webhook

First of all you need to insert Motion URL in Apps section → Webhooks
To create a new webhook you can click on Add Webhook

  • target type: HTTP

  • target url: composed by https://{MOTION_URL}/api/whatsapp/accounts/{WHATSAPP_CONNECTOR_ID}/notify

  • secret token for security to prevent a third element from sending messages

  • triggers: add all available triggers

Info

OAuth2 authentication is not supported, authentication is via secret token

  • Click on Create

Create a new Whatsapp Account

On Motion, as Admin you can create a new Whatsapp Account from WhatsApp Connector section.

  • Name

  • Key

  • Choose a List

  • Proxy or Motion Domain: public ID (important also for attachments that will be downloaded from here)

  • Type = Sinch V2

  • Base URL = EU Production or US Production which must be equal to region inserted in app

  • Sinch Project ID to copy from Conversation API → Overview

  • Sinch App ID to copy from Conversation API → Overview

  • Sinch Key ID to create in Settings → Access Keys → New Key

Note

When you create a New Key, you will view a visible Key ID and a Key Secret which will disappear, so you need to copy it immediately to insert it on Motion. These two keys are associated to project

  • Sinch Key Secret value from Settings → Access Keys

  • Sinch webhook optional added security token: secret token created before

  • Phone: phone number inserted in sinch with prefix ( Conversation API → Apps)

  • Optional description

And click ADD


Then you need to add agents or queue to the created Whatsapp Account.

Editing the account, you can see on Settings → General → Receive URL your url including tokens.

To change settings you can edit them in Advanced section.

Use Whatsapp Connector with Sinch for Agents

The feature is available on Whatsapp Connector section, from which agents choose accounts.
Agents need to enable the new created account connected to Sinch V2 to receive new interaction from this account

How to migrate from Whatsapp API to Conversation API

If you want to migrate using Sinch V2, it means that you already have a Whatsapp API with a configured sender and approved templates

On Synch side you need to:

(These parameters are essential to configure Whatsapp Connector Account on Motion side)

  • Create Webhook App in Sinch conversation API → Apps → Webhooks and in target url you can insert: https://{MOTION_URL}/api/whatsapp/accounts/{WHATSAPP_CONNECTOR_ID}/notify

On Motion side, environment accessible via HTTPS, you should already have a Whatsapp Account with old Sinch.

  • (warning) To avoid service interruptions, we suggest you create a new Whatsapp Account Sinch V2. Be careful that once the migration will take place, messages arrive on the new account (For reports it’s important to consider it, because you will find interaction only on this new account). So you need to create a new onewith the same:

    • settings: list, notification template, transfer options, routing parameters, dispositions, canned answer

    • action flow

    • (info) associated queue and agents. It’s very important to add permissions to agents to allow the receiving of interactions

Info

Useful Tip: you can create a queue, by associating both the old and the new account, so you are sure that all interactions will arrive in the queue and when the switch will be complete, there will be continuity on the queue

  • In this account you need to insert parameters related to Sinch Conversation API Project (Sinch Project ID, Sinch App ID, API Key, Key Secret) created before

  • Moreover you need to copy Motion Url, Whatsapp Connector ID account and secret token to configure Webhook App on Sinch side

Then you must ask to your account manager by email to switch from Whatsapp API to Sinch V2 (to associate sender phone number to new App project) sending:

  • Sinch App ID: you can copy it from Conversation API→ Apps

  • Sinch Project ID: you can copy it from Conversation API→ Overview

(tick) When account manager confirms migration finalisation, messages will pass via Conversation API

Note

Remember that after migration interactions will be available only on Sinch V2 Account (and not more on old account). Moreover old interactions will not continue on the new account, even if the phone number will be the same.
Check that you have correctly added agents and action flow for the successful reception of interactions

problemi comuni:
msg errore wa riceviamo in ritardo e non è legato a msg
xm-683
parte allegati: alcuni msg gestiti come link altri come msg nativo di wa (jpg o png)
supportati solo modalità service: cliente chiama, motion risponde
template modalità nusiness, utilitiy e autetnthcial work in progress

se ci sono problemi con invio allegato compare msg di sistema
se problemi da parte del cliente a invio su motion compare message error
problemi legati al fatto che utente manda allegato, sinch non riconosce msg e non invia (errore generico)
troubleshooting problemi comuni
media not reachable = alcuni file non supportati
controlalre https token proxy
gif non allowed non supportate da meta
non arrivano msg da wa a motion --> analytics su sinch e si vede cosa succede in failed message
controllare che wa account fatto bene in parti sinchsettings
in advanced
mettere motion in modalità debug
controllare log e inviarci in caso di problemi

msg da motion non arrivano su wa -->
mettere motion in modalità debug
controllare log e inviarci in caso di problemi

controllare sent messages su analytics
controllare api key in settings(nel caso se ne può creare una nuova)

potresti essere stato bloccato da meta (limnk fb policy)
wa business può bloccare senza preavviso, scritta guida e contattare account manager
(es. template non consentito o utente ti ha bloccato)
se tutte configurazioni apposto controllare qst