Skip to content

Maytapi WhatsApp Api Python Example You can test this bot with the following pre-configured messages: media media64 location reply link filepdf filedoc vcard contact product

Notifications You must be signed in to change notification settings

maytapi-com/whatsapp-api-python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maytapi - WhatsApp Api Bot Example

A simple python bot for Maytapi WhatsApp Api

Our WebsiteWhatsApp Api DocumentationsWhatsApp Api Postman Collection

  • In this example we echo the text messages back to user.
  • We use ngrok to create temporary https reverse proxy so whatsapp can reach our demo api.
  • Because ngrok public url changes everytime we also change webhook settings in our instance at boot. This should not be used like this in production environments.
  • NOTE: Before testing the demo you need to create your phone instance and connect an active WhatsApp account to instance in Phones Page.

Installation

Installing python libraries

pip install -r requirements.txt

Configure Tokens

You need to change PRODUCT_ID, PHONE_ID and API_TOKEN values in app.py file. You can find your Product ID and Token in Settings Token Page. Phone Id can be found in Phones Page or with /listPhones endpoint.

Start The Api

Tested with python v3.8.1

Mac/Linux

export FLASK_APP=app.py
flask run --host 0.0.0.0 --port 9000 --no-debugger --no-reload

Windows Cmd

set FLASK_APP=app.py
flask run --host 0.0.0.0 --port 9000 --no-debugger --no-reload

Windows PowerShell

$env:FLASK_APP = "app.py"
flask run --host 0.0.0.0 --port 9000 --no-debugger --no-reload

You can test this bot with these preconfigured messages:

  • media
  • media64
  • location
  • reply
  • link
  • filepdf
  • filedoc
  • vcard
  • contact
  • product
  • Poll
  • Sticker

About

Maytapi WhatsApp Api Python Example You can test this bot with the following pre-configured messages: media media64 location reply link filepdf filedoc vcard contact product

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published