Created
October 13, 2022 16:47
-
-
Save ritik1009/f814b5c91d96158ab0c1fd08921bfa5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask,request | |
app = Flask(__name__) | |
@app.route('/messenger_listner',methods=['POST','GET']) | |
def listner(): | |
if request.method == 'POST': | |
print("\n recived_data",request.json) | |
return 'success', 200 | |
elif request.method == 'GET': | |
print("\n received data: ", request.json) | |
challenge = request.args.get('hub.challenge') | |
print("\n Challenge",challenge) | |
if challenge == None: | |
return '',200 | |
else: | |
return challenge | |
else: | |
return '',200 | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment