Last active
November 1, 2017 22:30
-
-
Save teenoh/5e1b8b92d69f42c8c45a4703c0bc62c4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import json | |
import requests | |
from flask import Flask, request | |
VERIFY_TOKEN = "giphy" | |
app = Flask(__name__) | |
@app.route('/', methods=['GET']) | |
def verify(): | |
# Once the endpoint is added as a webhook, it must return back | |
# the 'hub.challenge' value it receives in the request arguments | |
if (request.args.get('hub.verify_token', '') == VERIFY_TOKEN): | |
print("Verified") | |
return request.args.get('hub.challenge', '') | |
else: | |
print('wrong verification token') | |
return "Error, Verification Failed" | |
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