Skip to content

Instantly share code, notes, and snippets.

@chankruze
Created January 10, 2023 06:50
Show Gist options
  • Save chankruze/69757de959179b6de1e7e108edcc379e to your computer and use it in GitHub Desktop.
Save chankruze/69757de959179b6de1e7e108edcc379e to your computer and use it in GitHub Desktop.
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def ReturnJSON():
if request.method == 'POST':
data = {"event": "Message Receive",
"messageID": "wamid.HBgMOTE4MTQ0MzU2NzY3FQIAEhggN0MxQUZCNDg2OTc1ODBBMTIxREQ0MDIwMzkyNTRDQ0IA",
"message": {"text": "log me into nootp"}, "created_at": "2023-01-10T06:22:55.602879Z",
"messageType": "Text", "media": "", "replyMessage": "", "messageStatus": "Delivered",
"whatsappNumber": "918144356767", "ContactName": "chankruze", "initiatedByBusiness": False}
return jsonify(data)
if __name__ == '__main__':
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment