Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple Kloudless API webhooks receiver for testing purposes
#!/usr/bin/env python
"""
This is a simple webhooks receiver for testing purposes. It should NOT be used on
production as it does not verify the sender. For an example that does, check out
http://blog.kloudless.com/2014/10/19/getting-started-with-kloudless-webhooks/
To install dependencies and run:
$ pip install flask
$ APP_ID=123ABC python kloudless_webhooks.py
* Running on http://127.0.0.1:5000/
where 123ABC should be replaced with your Kloudless App ID.
You can proxy requests from Kloudless to this local server by using http://ngrok.io.
Install it and then run `./ngrok http 5000` to send requests to this Flask server.
"""
import os
from flask import Flask, request
app = Flask(__name__)
@app.route("/", methods=["GET", "POST"])
def app_id():
if request.data:
print "Incoming notification: %s" % request.data
return os.environ["APP_ID"]
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
You can’t perform that action at this time.