Use facebook graph api to get events from a page

I'm trying to get the events from a facebook page using the graph api. I successfully get a access token using:

https://graph.facebook.com/oauth/access_token?client_id='+APP_ID+'&client_secret='+APP_SECRET+'&grant_type=client_credentials

I then try getting events from the page facebook.com/workmans.clubnights/ using

https://graph.facebook.com/workmans.clubnights/ events ?access_token=XXXXXXXXXXXXXXXXXXXXX

However I get an empty response.

Other requests are successfull such as https://graph.facebook.com/workmans.clubnights/?access_token=XXXXXXXXXXXXXXXXXXXXX

I feel this may be a permissions problem. Is it possible to get the events from a page?


I'm trying to get the events from a facebook page

Are you – I mean, really …?

I then try getting events from the page facebook.com/workmans.clubnights/

OK, so you are not – not from a page, because this is a user profile!

And according to https://developers.facebook.com/docs/reference/api/user/, you need permission user_events or friends_events to read a user's events.

You are using an app access token to request the events – which might work, but only in case the user has connected to your app first and given the permission.

Of course, those are only the symptoms – the real problem resp. (deliberate?) mistake here is that you are using a user profile for something that clearly should be a fan page. (Provided this is actually your page. If so, you should check on the options to convert it into a fan page. Otherwise you might have a rude awakening some day when Facebook closes this account because it is not an account for a real person. And the same for www.facebook.com/somewherewednesday as well.)

链接地址: http://www.djcxy.com/p/32636.html

上一篇: 图表API:检索页面Feed中的图片尺寸

下一篇: 使用facebook图形API从页面获取事件