Skip to content

Instantly share code, notes, and snippets.

@kunal732
Created January 6, 2015 17:43
Show Gist options
  • Save kunal732/12e10028eb18422a9d05 to your computer and use it in GitHub Desktop.
Save kunal732/12e10028eb18422a9d05 to your computer and use it in GitHub Desktop.
pushing sendgrid event webhook into firebase
rom flask import Flask, request
import json, requests
from firebase import firebase
app = Flask(__name__)
firebase = firebase.FirebaseApplication('Your_Firebase_url_goes_here', None)
@app.route('/',methods=['POST'])
def foo():
json2 = request.json
data = {}
for event in json2:
for key, val in event.iteritems():
data[key] = val
r = requests.post('Your_Firebase_url_goes_here',json.dumps(data))
data = {}
return "OK"
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