A Django app for integrating with snowshoestamp
- python setup.py
- pip install requirements.txt
- add snowshoestamp to INSTALLED_APPS
- add url to sss endpoint
- register url with snowsheostamp as webhook callback
Required
SNOWSHOESTAMP_KEY : the oauth key for your app
SNOWSHOESTAMP_SECRET : the oauth secret for your app
Example Implementation
- Setup your urls.py to use the view below as the callback reciever or just use the default sss reciever
- Register the url "https://yourhost.com/sss/webhook/" as the webhook callback at snowshoestamp
- and that is it, you can now hook up the signal listener and get a signal event whenever a webhook event happens
url(r'^sss/', include('snowshoestamp.urls', namespace='snowshoestamp')),
Or
You can write a custom view, by extending our View and doing somethign more specific with the data, and hook the view up to a url and register that url with snowshoestamp.
from snowshoestamp.views import SnowshoeStampView
class MySnowshoestampWebhookRecieverView(SnowshoeStampView):
def post(self, request, *args, **kwargs):
print(self.stamp_serial)
print(self.stamp_data)
# do something amazing
return self.render_json_response({
'detail': 'Snowshoestamp Callback recieved',
'stamp_data': self.stamp_data
})
Please Note
If you use the SnowshoeStampView then a signal will be issued when recieving callbacks from snowshoestamp, which you can then listen for and do other amazing things.
Signal Example Implementation
from django.dispatch import receiver
from snowshoestamp.signals import snowshoestamp_event
@receiver(snowshoestamp_event)
def on_snowshoestamp_callback(sender, stamp_serial, **kwargs):
# do something amazing with the data in the kwargs dict
pass
TODO
testsmore descriptive readme.md- improve setup.py to install from requirements
fix broken python_sdk install cant install from pip lacks setup.py