Froyo
Froyo

Reputation: 455

Get Facebook Pages Events using graph Api

I am trying to fetch facebook events from a pages profile using facebook graph api. The method i was using is like below

HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("https://graph.facebook.com/oauth/access_token?client_id="+APP_ID+"&client_secret="+APP_SECRET+"&grant_type=client_credentials");
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String access_token = client.execute(get, responseHandler);
String uri = "https://graph.facebook.com/PageName/events?"+access_token.replace("|","%7C");
get = new HttpGet(uri);
String responseBody = client.execute(get, responseHandler);

in which APP_ID, APP_SECRET and PageName i am replacing with my details. There is no issue as its working and i am getting the response also from Facebook as a json array which includes name,start_time,end_time,timezone,location,id of the events, but there is no event description.

How to fix this?

Upvotes: 2

Views: 4549

Answers (2)

Anvesh Saxena
Anvesh Saxena

Reputation: 4466

By default you don't get event description but you can add the same in using fields along with other information you require and retrieve more detailed listing. So you need to change your uri to

String uri = "https://graph.facebook.com/PageName/events?fields=name,start_time,timezone,location,description"+access_token.replace("|","%7C");

To retrieve the required information.

Upvotes: 5

Sahil Mittal
Sahil Mittal

Reputation: 20753

Use the Event ID you get in the response, and use it to get each and every detail of that event from:

"https://graph.facebook.com/EVENT_ID"

Upvotes: 3

Related Questions