django - Create Facebook Event with python's urllib2 library -
i'm trying create event
facebook external application. i've read this con events, states can create event via post, have following-
data = dict() data['access_token'] = self.access_token data['name'] = 'fb event python!' data['start_time'] = datetime.datetime.now().isoformat() data = urllib.urlencode(data) url = 'https://graph.facebook.com/me/events' request = urllib2.request(url=url, data=data) response = urllib2.urlopen(request)
where have access token , fb permissions set app can create events , forth. error 400 = bad request
, if i'd more happy in advance
well should think using facebook-sdk. error i.e http 400 know doing wrong how sending http request itself. request requires parameters in form not giving. if @ request function in here
it makes request in form path id( not sure me valid here, perhaps can use me resource access-token using)
i think args access token .
file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" + urllib.urlencode(args), post_data, timeout=self.timeout)
thus change form in making request. can go through facebook.py's code , docs figure out variables mean based on needs
Comments
Post a Comment