At times, you may want to send sms from Sinch REST API directly instead of sending sms via a campaign on MoEngage dashboard. This is generally the recommended approach for your transactional use-cases like payment updates, OTP etc.
The Data Integration with Sinch allows you to capture the sms delivery reports in MoEngage for messages sent directly using Sinch REST API.
Scope of Integration
This Integration allows you to track sms delivery receipts like SMS Sent, SMS Delivery Failed and SMS Delivered in Moengage.
Enabling the Sinch Data Integration for your MoEngage account
This integration can only be enabled on demand. If you have a use-case to forward sms delivery receipts from Sinch to MoEngage for your transactional messages sent via Sinch, you can reach out to your Moengage Customer Success Manager or write to firstname.lastname@example.org.
Please note that this is only required to see sms delivery events on MoEngage dashboard for sms that you send directly using sinch API. For sms sent via MoEngage campaigns, this is not required.
Configurations on the Sinch Dashboard
To setup this data integration, please follow the below steps -
- Go to your sinch dashboard -> SMS -> APIs -> select your service plan id and configure the callback URL as shown below -
- Add webhook URL - https://api.moengage.com/v1/deliveryfeedback/sinch/<your_app_key> on the sinch dashboard where app_key is the app_key of your MoEngage account and available on your MoEngage dashboard here. (Settings -> App Settings)
Changes to your Sinch REST API request
To capture the delivery receipts from Sinch, there are a few things to note here
- When sending sms via Sinch API directly, it is mandatory that you send a key value pair for uid under client_reference. The value of uid should be the same as the value of the ID (also called the customer_id) on the MoEngage user profile (see reference below)
Please note that any delivery events without this uid field will be rejected by MoEngage.
- To track category, you need to add the key - "cat" under client_reference in your sinch sms API request. This is not mandatory.
A sample Sinch REST API request with uid and other moengage params would be like below -
"body": "Hi there! How are you?",
Events tracked in MoEngage
Once the configurations are done on the Sinch dashboard and you are passing the mandatory uid parameter in your API request to Sinch, you will start seeing events on MoEngage dashboard user profile as shown below -
The different events that you would be able to see on the MoEngage dashboard are as below -
- SMS Sent
- SMS Delivered
- SMS Delivery Failed
Please note that if we are unable to find a user with the uid present in the event request from Sinch, MoEngage will create a new user. This might affect your stats and total user count in moengage so always ensure to send a correct value for uid in your Sinch REST API request.