Graph API调用Facebook公开页面事件列表返回空数据的权限咨询
{page-id}/events Responses in Facebook Graph API I’ve run into this exact issue before, so let’s walk through the most likely reasons you’re getting an empty data array when calling matrixberlin/events—even though the page’s events are publicly visible. Here’s what to check:
1. Permissions Are Probably the Culprit (Even for Public Events)
Facebook’s Graph API tightened permissions in newer versions (v18.0+), and public page events still require specific scopes depending on your access token:
- User Access Token: You’ll need the
pages_read_engagementpermission. This scope lets you pull page content like events, even for public pages. If your token doesn’t have this, the API will return empty results instead of an error (annoying, I know). - Page Access Token: If you generate a page-specific token (via the Graph API Explorer by selecting the page under "Get Token"), you might not need extra scopes for public events—but confirm the token is valid for Matrix Berlin.
- Quick Check: Use the Explorer’s "Debug" tool to inspect your token’s permissions. If
pages_read_engagementisn’t listed, you’ll need to re-request the token with that scope.
2. You’re Only Fetching Upcoming Events (Default Behavior)
By default, /{page-id}/events returns only upcoming events. If all events on Matrix Berlin are already finished, you’ll get an empty array. Fix this by adding the type parameter:
GET /matrixberlin/events?type=past
Or use type=all to grab both upcoming and past events at once.
3. Double-Check Event & Page Settings
Even if events are marked "Public", there could be hidden restrictions:
- Make sure the page isn’t region/age-restricted (some public pages limit visibility in certain countries).
- Confirm events are published, not saved as drafts. Draft events won’t show up in API responses, even if they’re set to public.
4. Verify Your Page ID & Token Validity
Sometimes vanity URLs like matrixberlin can have mapping issues—try using the page’s numeric ID instead (you can find this in the page’s About section or via the Graph API). Also, ensure your access token hasn’t expired and is scoped to access page content (some tokens are limited to user data only).
内容的提问来源于stack exchange,提问作者Karl Heinz Mueller

