Created
November 2, 2015 01:36
-
-
Save saikat/37a49e384cebf73ddb06 to your computer and use it in GitHub Desktop.
bsd.py
This file contains 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
import os, json | |
from bsdapi.BsdApi import Factory | |
from bsdapi.RequestGenerator import RequestGenerator | |
from bsdapi.URL import URL | |
from django.conf import settings | |
from time import time | |
api = Factory().create( | |
id=settings.BSD_ID, secret=settings.BSD_SECRET, | |
host=settings.BSD_HOST, port='80', | |
securePort='443') | |
def create_event(event_type_id, creator_cons_id, name, description, venue_name, venue_zip, venue_city, venue_state_cd, *args, **kwargs): | |
params = { | |
'event_type_id': event_type_id, | |
'creator_cons_id': creator_cons_id, | |
'name' : name, | |
'description': description, | |
'venue_name': venue_name, | |
'venue_zip': venue_zip, | |
'venue_city': venue_city, | |
'venue_state_cd': venue_state_cd, | |
} | |
resp = api.doRequest('/event/create_event', params, api.POST, None) | |
print resp | |
return json.loads(resp.body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment