Skip to content

Instantly share code, notes, and snippets.

@Gaikanomer9 Gaikanomer9/
Last active Jan 10, 2019

What would you like to do?
Sample Flask app for webhook handling at Dialogflow
# -*- coding: utf-8 -*-
from flask import Flask, request, make_response, jsonify
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
req = request.get_json(force=True)
intent = req.get('queryResult').get('intent').get('displayName')
if intent == 'Sample intent':
res = make_response(jsonify(
"fulfillmentText": "Привет от сервера!",
return res
return make_response(jsonify(
"fulfillmentText": "Совпадений намерений не найдено!",
if __name__ == '__main__':'', debug=True, port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.