Instant - SINCH V2 Provider Setup

In the following section you find how to setup the Sinch V2 Solution Provider.

General Requirements

This integration requires:

a valid WhatsApp Solution Provider account with a positive balance. In fact consider that to use WhatsApp, on XCALLY side you need to enable the connector, while for interactions management you need to consult the official documentation of the selected provider to check prices: find out Sinch documentation at this link

the WhatsApp API enabled on your the WhatsApp Solution Provider account

a business sender number profile approved by WhatsApp in advance

The Motion instance must have a public address accessible via HTTPS. For security reasons we strongly recommend to use a Reverse Proxy → find out more

 

SINCH account

There are two important sections on SINCH:

  • WhatsApp (“old section” for WhatsApp API, so SINCH V1, deprecated by the end of September 2023)

  • Conversation API → section to configure SINCH v2

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 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.
    On SINCH we support only Instagram and WhatsApp

  • 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

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 (not recommended action)

  • Processing Mode: Conversation mode

  • On Set up channels you can setup 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

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

How Admin can configure SINCH on Motion

 

 


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
    If not sure, there is a cortesy URL ready to be copy pasted in WhatsApp Connector → WhatsApp Accounts → Settings → Receive URL

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

  • triggers: you must add all available triggers

  • 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

  • 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 to manage interactions.

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

For Agents, the feature is available on WhatsApp Connector section, from which they have to select accounts.
In fact 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 have already a WhatsApp API with a configured sender

 

On SINCH side you need to:

(These parameters are essential to configure the new 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, you should have already a WhatsApp Account with WhatsApp API.

  • 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 one with the same:

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

    • action flow

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

  • 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 to switch from WhatsApp API to SINCH V2 (to associate sender phone number to the new App project) sending by email:

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

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

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

 

Troubleshooting

WhatsApp messages don't arrive to SINCH

SINCH messages don't arrive to Motion

Motion doesn't open interaction

WhatsApp attachment doesn't arrive to SINCH

Verify if number is blocked by META and check SINCH Analytics

Check https, webhook url, webhook events, webhook secret, check if motion account ID is correct, set motion to debug and check logs

Check admin open interactions, assigned agents and assigned queue

Not all attachments are available for WhatsApp business, check motion debug logs

 

 

 

 

Attachments is not saved to motion

Motion can't send messages to WhatsApp

Motion attachment refused by WhatsApp

Motion can't send messages to SINCH

Check Motion disk space, check WhatsApp account proxy url and proxy token settings

Check SINCH analytics failed messages, check Motion debug logs

Some attachment types can't be sent on WhatsApp. A link will be used if possible, if not use another channel like email

Check WhatsApp account SINCH settings

 

Supported attachment

Some messages are managed as link while others as native WhatsApp messages (e.g. jpg or video).
For more information explore this page: Media Message | Conversation API | Sinch

✔️⚠️CSV → shown as link

❌DOC → Error CHANNEL_FAILURE

❌GIF → Error CHANNEL_FAILURE (GIF not allowed because not supported by Meta)

✔️JPG → shown as media with preview

✔️MP3 → shown as audio with preview

✔️MP4 → shown as video with preview

✔️⚠️PDF → shown as link

✔️PNG → shown as media with preview

❌WAV → Error BAD_REQUEST

✔️DLL → shown as link

❌EXE → Error BAD_REQUEST

If there are issues sending attachment, a system message appears

 

 

Supported messages

Messages are supported only on Service mode (Business Mode, Utility and Authentication are work in progress).

Messages are supported only on Conversation Mode (not dispatch mode)

If there are issues by customer side to send attachments and SINCH doesn’t recognise the message and it doesn’t send it, on Motion a general message error appears

 

You can explore here errors shown to the agent when a send message fails Callbacks | Conversation API | Sinch, including:

CHANNEL_FAILURE → you can contact XCALLY Support

MEDIA_TYPE_UNSUPPORTED --> file type not supported by WhatsApp. Remember that WhatsApp Business has some file types non allowed compared to traditional WhatsApp (e.g. not supported DOC, DOCX)

MEDIA_TOO_LARGE → you can check on this guide to know SINCH and WhatsApp limits
WhatsApp Message Support | Conversation API | Sinch

Attached weight > Motion limits > SINCH limits > WhatsApp limits
When you see this error, you are exceeding your SINCH or WhatsApp limit

MEDIA_NOT_REACHABLE → possible reasons: file deleted or renamed on the server, file deleted by interaction.
It cannot be caused by non-public url but you can check however that https token proxy is correct

BAD_REQUEST → you can contact XCALLY Support

MESSAGE_SPLIT_REQUIRED → too long text

ATTACHMENT_REJECTED → Error by WhatsApp Meta Side, attachment not allowed

 

 



Messages don’t arrive from WhatsApp to Motion

If messages don’t arrive from WhatsApp to Motion, you can check what happens on
SINCH → Conversation API → Analytics

In case of issues (e.g. message from Motion don’t arrive on WhatsApp), you can:

  • set Motion in debug mode

  • check logs and send them to us

Account blocked by Meta

It’s possible that WhatsApp Business is blocked without warning by Meta (e.g. if an unauthorised template was used or a user blocked you)

In this case you can check this guide of Facebook Policy and then contact your account manager.

Possible errors on Meta site which can hint about issues with Meta policies:

  • RECIPIENT_NOT_OPTED_IN,

  • OUTSIDE_ALLOWED_SENDING_WINDOW

  • DELIVERY_REJECTED_DUE_TO_POLICY

  • NO_PERMISSION

  • NO_PROFILE_AVAILABLE

  • INACTIVE_CREDENTIAL

 

Other possible errors: (you can explore details at the page Callbacks | Conversation API | Sinch )

Network errors, try again later:

  • RATE_LIMITED

  • DELIVERY_TIMED_OUT

  • MESSAGE_EXPIRED

  • CHANNEL_REJECT

SINCH configuration errors:

  • RECIPIENT_NOT_REACHABLE

  • CHANNEL_BAD_CONFIGURATION

  • CHANNEL_CONFIGURATION_MISSING

  • NO_CHANNELS_LEFT

  • TEMPLATE_NOT_FOUND

  • TEMPLATE_INSUFFICIENT_PARAMETERS

  • TEMPLATE_NON_EXISTING_LANGUAGE_OR_VERSION

  • UNKNOWN_APP

  • NO_CHANNEL_IDENTITY_FOR_CONTACT

XCALLY code errors, contact support:

  • RECIPIENT_INVALID_CHANNEL_IDENTITY

  • CHANNEL_FAILURE

  • CONTACT_NOT_FOUND

  • BAD_REQUEST

  • UNSUPPORTED_OPERATION

  • UNKNOWN

  • INTERNAL_ERROR

Related pages