Accessing Facebook events in groups through Graph API

I'm new to Facebook's API. I'm trying to use Facebook's Graph API to access the event data of a group (not a page).

I'm using a Facebook app to make the API calls via a simple Perl script. I can see the events exist in the groups when I visit the group on Facebook with my browser. But the events are not getting returned by the API call. I just get {"data":[]} returned. My Perl script works fine with API calls for public pages.

Is it possible to get access to the group event data via the API? If so, how? If not, is there some other way I can get access like making the API calls using my user account on Facebook?

use strict;
use warnings;
use JSON::Parse 'parse_json';
use LWP::UserAgent;
use Data::Dumper;

my $ua = LWP::UserAgent->new;

my $response = $ua->get('https://graph.facebook.com/oauth/access_token?client_id=blah&client_secret=blah&grant_type=client_credentials');

my $access_token = $response->decoded_content;

my $json = $ua->get('https://graph.facebook.com/v2.6/WestfieldCulturalDistrict/events?' . $access_token);
print Dumper $json->decoded_content;

https://developers.facebook.com/docs/graph-api/reference/v2.6/group/events

A user access token for a member of the group with user_groups permission.

...

By default this will only return events within the last two weeks, use until or since parameters to modify this range.

There is no user_groups permission anymore, i guess that´s why there is an important message on that page:

This document refers to a feature that was removed after Graph API v2.5.

So either that´sa bug in the Facebook docs, or it´s just not possible anymore to get group events. Not even with a User Token. You should try with one though (and user_managed_groups ).

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

上一篇: 获取URL的评论

下一篇: 通过Graph API访问组中的Facebook事件