MMS Gateway - Vonage API for WhatsApp

The Vonage API for WhatsApp MMS Gateway delivers WhatsApp 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 Messages 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

fmMMS 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 fmMMS 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 fmMMS file in in several ways:

  • Use Webhooks to have Vonage push these automatically to fmMMS using the supplied PHP file
  • 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 fmMMS automatically by Vonage as they are received.

Vonage Webhooks Setup

To receive incoming WhatsApp messages to your Vonage number, including replies to previously sent messages, you will need to use the supplied WebhooksIncomingMessages.php webhook file to act as the webhook receiver. See our Webhooks guide for what you need to do host the WebhooksIncomingMessages.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 Otto Webhooks Setup

Please visit the Webhooks using Otto guide for instructions on setting up Otto Webhooks for your Vonage number. You will need to create a new webhook and enter the Otto webhook URL using the instructions above and modify the OttoReceiver script to handle incoming WhatsApp messages from Vonage.

Still need help? Contact Us Contact Us