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 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 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


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

Info

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.

  • 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

Image RemovedImage Added

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)

(warning) 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

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

(tick) Interactions will be available on Sinch Account (and not more on old account)

(warning) Remember to add permissions to agents you want to activate also on this account

(warning) Remember to configure the same action flow also on this account

da minuto 38

https://phespa-my.sharepoint.com/personal/elisa_damato_ingogroup_it/_layouts/15/stream.aspx?id=%2Fpersonal%2Felisa%5Fdamato%5Fingogroup%5Fit%2FDocuments%2FRegistrazioni%2FDocumentazione%20SINCH%20v2%20e%20guida%20migrazione%2D20230726%5F100332%2DRegistrazione%20della%20riunione%2Emp4&referrer=Teams%2ETEAMS%2DELECTRON&referrerScenario=TMRChicletOpen%2Eview%2Eview&ga=1

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