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)
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.
In current implementation, templates are not supported in Conversation API, only incoming chats from Whatsapp where agents reply are supported
How to associate a sender and 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 apptwo 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
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
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
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 domain_name/api/whatsapp/accounts/wa_connector_account_id/notify
secret token for security to prevent a third element from sending messages
triggers: add all available triggers
OAuth2 authentication is not supported, authentication is via secret token
Click on Create
On Motion, as Admin you can create a new Whatsapp Account from WhatsApp Connector section.
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
How to migrate from Whatsapp API to Conversation API
If you want to migrate using Sinch V2 you need to:
Configure app on Sinch → Conversation API, creating a project and app
Create app webhook on Conversation API
Create API key
Have a Motion accessible via HTTPS and a Whatsapp account configured with Sinch V2
Ask to your account manager to change sender’s phone number or create a new sender, by associating it to the app project (to associate from Whatsapp API to Conversation API)
To avoid service interruptions, we suggest you create a new account with 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 the new account
When account manager confirms migration, messages pass via Conversation API
Interactions will be available on Sinch Account (and not more on old account)
Remember to add permissions to agents you want to activate also on this account
Remember to configure the same action flow also on this account
wa API
OTTIENI UN SENDER
APPROVAZIONE TEMPLATE
SINCH CONVERSATION PROJECT--> configura project / app / api key in setting / copia key value
con questi parametri configura WA connector
da synch vecchio usa stessa lista contatti / parametri instradamento / notification template / transfer setting / disposition / canned answer / actions routing / agenti / code
PRo tip: fai una coda con i due account associati alla coda così sei sicuro che interazioni arrivano in coda e quando fatto switch vedi continuità sulla stessa coda
attenzione che ci saranno nuove interazioni su nuovo account, non continuano quelle vecchie anche se stesso n° per problema tecnico di conversation api
dopo aver importare tutto com'era nel vecchio
indirizzo https pubblico motion
id account - wa connector - secret del webhook
coinfugrare webhook - app conversation api sinch
in sinch conversation api --> apps --> webhooks
in target url mettere codice id
chiediamo poi a sinch . email richiesta ad account manager di sinch - meta di cambiare da WA API a sinch
fornire APP ID e project ID
dopo ok msg arrivano su nuovo account
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