Simple bot to answer WhatsApp messages.
HTML form interacting with the function.
Receives a message, validates its signature, and sends a response back to the sender.
Name | Description | Location | Type | Sample Value |
---|---|---|---|---|
Content-Type | Content type of the request | Header | application/json |
N/A |
Authorization | Webhook signature for verification | Header | String | Bearer <signature> |
from | Sender's identifier. | Body | String | user |
text | Text content of the message. | Body | String | Hello World |
Response:
Sample 200
Response:
{
"ok": true
}
Sample 400
Response:
{
"ok": false,
"error": "Missing required parameter: from"
}
Sample 401
Response:
{
"ok": false,
"error": "Payload hash mismatch."
}
API Key to use the Vonage API.
Question | Answer |
---|---|
Required | Yes |
Sample Value | P2...97 |
Vonage WhatsApp number to send messages from.
Question | Answer |
---|---|
Required | Yes |
Sample Value | 1234567890 |
ACCOUNT_SECRET to use the Vonage API.
Question | Answer |
---|---|
Required | Yes |
Sample Value | p524...97 |
Secret to verify the webhooks sent by Vonage.
Question | Answer |
---|---|
Required | Yes |
Sample Value | ZACYi3...ZXGjsch |
Setting | Value |
---|---|
Runtime | Bun (1.0) |
Entrypoint | src/main.ts |
Build Commands | bun install |
Permissions | any |
Timeout (Seconds) | 15 |