SMS Gateway - Vonage API for WhatsApp
The Vonage API for WhatsApp SMS Gateway delivers SMS messages internationally to WhatsApp users. You can get more information about the features of the WhatsApp Business API here:
https://www.vonage.com/communications-apis/messages/features/whatsapp/
There are some important differences that are unique to WhatsApp compared with the regular Vonage SMS API. WhatsApp divides messages into two different types: Template messages and Session messages. These determine when you can initiate a message to a WhatsApp user.
You can get further information on Template messages and Session messages here:
https://developer.vonage.com/en/messages/concepts/whatsapp
fmSMS supports using the Vonage WhatsApp Messages API Sandbox for testing sending WhatsApp messages for free whilst you are developing an integration with WhatsApp. Not all features of the production Messages API are supported by the Messages API Sandbox: you can get more information about the Messages API Sandbox and the supported features here:
https://www.vonage.com/about-us/vonage-stories/introducing-vonage-messages-api-sandbox/
https://developer.vonage.com/en/messages/concepts/messages-api-sandbox
To enable Sandbox mode in fmSMS click the Use Sandbox Mode checkbox in the Accounts Form layout:
For information on sending WhatsApp Message Templates please see our Vonage API for WhatsApp Message Templates guide.
Incoming Messages/Replies
You can get incoming messages/replies to your Vonage number into the fmSMS file in in several ways:
- Use Webhooks to have Vonage push these automatically to fmSMS using the supplied PHP file
- Use Claris Connect Webhooks
- Use Otto Webhooks
Using Webhooks is the preferred method as it saves you from having to poll/check for any new messages - with Webhooks new messages are forwarded to fmSMS automatically by Vonage as they are received.
Vonage Webhooks Setup
To receive incoming SMS messages to your Vonage number, including replies to previously sent messages, you will need to use the supplied incomingMessage.php webhook file to act as the webhook receiver. See our Webhooks guide for what you need to do host the incomingMessage.php file on your chosen web server. Once you have the publicly accessible URL for this file you can enter this into your Vonage account settings by creating an Application and entering the URL for the Messages Inbound URL. You can learn more about Messages API webhooks in the documentation
It should look similar to this screenshot:
You can also test Webhooks with the Messages API Sandbox by entering the URL to the php file in your Sandbox Dashboard here:
https://dashboard.nexmo.com/messages/sandbox
It should look similar to this screenshot:
Vonage Claris Connect Webhooks Setup
Please visit the fmSMS Webhooks using Claris Connect guide for instructions on setting up Claris Connect Webhooks for your Vonage number.
Vonage Otto Webhooks Setup
Please visit the Webhooks using Otto guide for instructions on setting up Otto Webhooks for your Vonage number.