Skip to content

Instantly share code, notes, and snippets.

@teenoh
Last active November 1, 2017 22:30
Show Gist options
  • Save teenoh/5e1b8b92d69f42c8c45a4703c0bc62c4 to your computer and use it in GitHub Desktop.
Save teenoh/5e1b8b92d69f42c8c45a4703c0bc62c4 to your computer and use it in GitHub Desktop.
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