vonage-python-code-snippets/jwt/decode-jwt at main · oooooooo/vonage-python-code-snippets · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

README.md

This quick demo shows how to verify an incoming Webhook signature. Your account must be enabled for signed webhooks, and you must have an existing application with the "Messages" capability enabled.

For signed incoming SMS signatures through the Messaging API, please see the snippet for verifying a signed incoming SMS message instead.

Usage

Setup

Install using either pipenv or virtualenv, and then set up the webhooks.

pipenv

  1. Run pipenv install
  2. Copy .env.dist to .env and fill in your credentials
  3. Run pipenv run flask

virtualenv

  1. Run virtualenv env
  2. Run source env/bin/activate
  3. Run pip install -r requirements.txt
  4. Copy .env.dist to .env and fill in your credentials
  5. Run flask run

Set up incoming webhook

  1. Start ngrok with ngrok http 3000. ngrok will give you a forwarding address you can now use for your delivery receipts.
  2. Copy this URL and go to your customer dashboard
  3. Click on "Your Applications"
  4. Click the three dots and select "Edit" for the application you are using on the application you are using
  5. Under "Capabilities", enter https://your-ngrok-url for the "Inbound URL" and "Status URL" boxes, and makes sure both are set to "POST"
  6. Click "Save"

You can now send an SMS to the number linked in your application, and the sample app will verify the incoming signature.