Vonage
note
Currently, only WhatsApp is supported on this channel.
- Local deployment
- Botpress Cloud (beta)
Prerequisite​
An HTTPS Endpoint to your bot
- Set the externalUrl field in
botpress.config.json
- Create an HTTPS tunnel to your machine using Ngrok. Tutorial
- Using Nginx and Let's Encrypt. Tutorial
- Set the externalUrl field in
- Give it a name
- Under
Authentication
, click Generate public and private key (this will download a file calledprivate.key
. You will need this file later on.) - Click Generate new application
Get your API credentials​
- Go to your Account Settings.
- Scroll down and copy your API key, API secret and Signature secret from the LIVE credentials section.
- Go to your applications and select your newly created application (https://dashboard.nexmo.com/applications/).
- Copy the Application ID.
Configure your bot​
- Edit
data/bots/<YOUR_BOT_ID>/bot.config.json
. In themessaging.channels.vonage
section write this configuration:
enabled
: set totrue
;apiKey
: paste your API key;apiSecret
: paste your API Secret;signatureSecret
: paste your Signature secret;applicationId
: paste your Application ID;privateKey
: paste the content of theprivate.key
file that was generated when you created your Vonage Application;- Paste the full key value, including the
-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----
lines; - Replace all line breaks with the newline character
\n
;
- Paste the full key value, including the
useTestingApi (optional)
: set totrue
if you want to use theSandbox
instead of theLive
version of Vonage API (see Setup a Messages Sandbox).Your
bot.config.json
should look like this:
{
// ... other data
"messaging": {
"channels": {
"vonage": {
"enabled": true,
"apiKey": "your_api_key",
"apiSecret": "your_api_secret",
"signatureSecret": "your_signature_secret",
"applicationId": "your_application_id",
"privateKey": "your_private_key",
"useTestingApi": false
}
// ... other channels can also be configured here
}
}
}
- Restart Botpress.
- You should see your webhook endpoint in the console on startup.
Setup a Messages Sandbox​
When wanting to test the integration with Vonage and WhatsApp, you need to enable a Sandbox where you can send test messages.
In the left end side menu of Vonage Dashboard select Messages and Dispatch (beta)
Click Sandbox.
Click the channel you want to setup and follow the instructions detailed on the page.
Under
Webhooks
, type the following URLs:Inbound:
<EXTERNAL_URL>/api/v1/messaging/webhooks/<YOUR_BOT_ID>/vonage/inbound
Status:
<EXTERNAL_URL>/api/v1/messaging/webhooks/<YOUR_BOT_ID>/vonage/status
File Reception​
Vonage currently supports receiving image
, audio
, video
, file
, and location
.
note
Please, keep in mind that the links coming from the Vonage API are only valid for 10 minutes.
An action (Storage - Store File Locally) is available in order to store the file locally.
Vonage
Requirements​
Create Vonage Application​
You will need a Vonage Account and a Vonage Application to connect Vonage to Botpress
Channel Configuration​
API credentials​
- Go to your API Settings.
- Copy paste the API key to the API Key channel configuration
- Copy paste the API secret from the Account credentials section to the API Secret channel configuration
- Copy paste the signature secret from the Signed webhooks section to the Signature Secret channel configuration
Save Configuration​
Channel configuration is complete, you can now click Save
Webhook Configuration​
Sandbox​
You can use the Vonage sandbox to test you channel with Whatsapp
- Check the Use Testing API box in your channel configuration
- Go to your Sandbox Settings
- Copy paste the webhook url provided in the channel configuration UI to the Inbound and Status fields in the Webhooks section