开发者

Integrating web app with facebook events api

Hi I have web app where user creates an event. Its a java/j2ee based web application and I have used mysql 5.1 at the back end. Once the user creates the event on my web app, the event information like when,where,start-time,end-time etc should be transferred to user's facebook profile and he should le to invite the attendees via fb. Is there any library readily available or should I dirt my hands coding. I have used jquery and javascript, if there is any jquery or js library available please let help me 开发者_开发问答out


To accomplish this you will need to do two things:

  1. Authenticate a user for an app you build using Facebook Platform
  2. Use the access token you retrieve after authenticating them to publish an Event on Facebook

Step 1 can be done in a number of ways, as explained on the Authentication docs, but considering you are already familiar with Javascript, you should use the Facebook Javascript SDK to do this, in particular the FB.login method. The 'scope' (or Permissions) you will need to request for step 2 are: user_events and publish_stream

Once you have an access token for the user after step 1, then you can proceed to publish an Event on their behalf using the Graph API. This is really simple. Again, using the Javascript SDK you would make a call similar to:

FB.api('/me/events', 'post', { PARAMS }, function(response) { HANDLE RESPONSE });

Using the parameters outlined here: http://developers.facebook.com/docs/reference/api/user/#events

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜