Use Glitch to create a sample app with an endpoint to test your webhooks. Glitch will provide a public URL served over HTTPS for your webhook.
Follow these steps to generate a test Webhooks endpoint for the Cloud API:
app.js
file, update the value of the VERIFY_TOKEN
to a random string of your choosing.
const VERIFY_TOKEN = "hello";
/webhook
at the end of the URL to get your complete callback URL. It will look something like https://<project-name.glitch.me/webhook
.server.js
in the left navigation to for the Webhook endpoint implementation.
https://<project-name.glitch.me/webhook
.
Incoming webhook: {"messages":[{"from":"1234567890","id":"ABGGhSkIc2B_Ago-sDy5BNm-1gI5","text":{"body":"Hi"},"timestamp":"1529381066","type":"text"}]} Incoming webhook: {"statuses":[{"id":"gBGGhSkIc2B_AgkXDygfSDwgG5s","recipient_id":"1234567890","status":"sent","timestamp":"1529381072"}]} Incoming webhook: {"statuses":[{"id":"gBGGhSkIc2B_AgkXDygfSDwgG5s","recipient_id":"1234567890","status":"delivered","timestamp":"1529381072"}]} Incoming webhook: {"statuses":[{"id":"gBGGhSkIc2B_AgkXDygfSDwgG5s","recipient_id":"1234567890","status":"read","timestamp":"1529381076"}]}