Skip to content
/ PyWhatsapp Public template

Chatbot created via Whatsapp Cloud API, deployable on Heroku

License

Notifications You must be signed in to change notification settings

NullCode1337/PyWhatsapp

Repository files navigation

[FIXED] WhatsApp Cloud API Webserver

This is a template for generating Whatsapp bots which are immediately deployable to Heroku, powered by Meta's Whatsapp Cloud API

Setup

Deploy

  1. You can deploy this sample app on Heroku (for testing) by clicking here:

    Deploy

  2. Add a name and region for this bot, then click Deploy App button.

    Preview

  3. Wait for the build to finish

    Preview

  4. When Heroku has successfully deployed your application, click on Manage App

    Preview

  5. Go to the Settings > Reveal Config Vars, and add the following variables:

TOKEN: <your temporary access token or permanent token from Whatsapp/Getting Started>
PHONE: <your phone number ID from Whatsapp/Getting Started>
APP_SECRET: <any random string (no numbers) which you will also add to Meta Webhooks>
  1. When you have finished, click Open app. You'll be sent to a website which says "Hello, It Works"

    Preview

    Preview

  2. Now your callback URL will be https://<app_name>.herokuapp.com/whatsapi

    Preview

  3. Open Meta Developers Whatsapp/Configuration panel and click "Edit" beside webhooks textbox

image image

  1. On the dialog box, for Callback URL enter https://<app_name>.herokuapp.com/whatsapi

  2. For Verify Token enter the APP_SECRET you previously set on Heroku. Click Verify and Save.

image

References

  1. WhatsApp Cloud API official documentation
  2. Heyoo WhatsApp API Python Wrapper
  3. Create a Facebook App ID App Secret

Credits

  1. Jaxparrow [Original Creator]
  2. NullCode1337 [Revamped project]