Skip to content

Instantly share code, notes, and snippets.

@phalt
Created September 29, 2014 12:45
Show Gist options
  • Select an option

  • Save phalt/d34c4aa86d1b4989c3b4 to your computer and use it in GitHub Desktop.

Select an option

Save phalt/d34c4aa86d1b4989c3b4 to your computer and use it in GitHub Desktop.
Twilio App Monitor Webhooks part 4
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