Created
September 29, 2014 12:45
-
-
Save phalt/d34c4aa86d1b4989c3b4 to your computer and use it in GitHub Desktop.
Twilio App Monitor Webhooks part 4
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
| from flask import Flask, request | |
| app = Flask(__name__) | |
| @app.route('/error_trigger', methods=['POST']) | |
| def error_triggers(): | |
| error_code = request.values.get('ErrorCode', None) | |
| description = request.values.get('Description', None) | |
| if error_code: | |
| msg = 'An error on Twilio occurred! ' + description | |
| doc_url = ' https://twilio.com/docs/errors/' + error_code | |
| msg += doc_url | |
| return msg | |
| 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