使用Graph API创建页面、修改封面时遇(#10)权限错误,发帖正常求助
Hey, let's work through this permission issue together—since you're already posting feeds successfully, you've got the basics down, so this is likely just a permission scope or app setup detail you missed.
First, let's recap your scenario to align:
- Your access token and page IDs are valid (proven by working feed posts)
- You hit
(#10) Application does not have permission for this actionwhen:- Creating a page via
POST https://graph.facebook.com/10216XXXXXX509/accountswith params{'name': 'XXpage nameXX', 'category_enum': 'EDU_SITE', 'access_token': 'EA...ZD', 'about': 'This page presents ...'} - Updating a page cover via
POST https://graph.facebook.com/27717XXXXXX336with params{'cover_id': '236795307270833', 'offset_x': 50, 'offset_y': 39, 'access_token': '...'}
- Creating a page via
- Your app is currently in Developer Mode
Here are the key areas to check, ordered by likelihood:
1. You're Missing the Required Permission Scope
Posting feed posts uses permissions like pages_manage_posts, but creating pages and updating page metadata (like covers) require a different, specific scope: pages_manage_metadata.
This is the most common culprit here—even if your app has other page-related permissions, you need to explicitly request this one when generating your access token.
To verify:
- Head to the Access Token Debugger in your Facebook Developer Portal (under Tools for your app)
- Paste your access token and check the "Scopes" section. If
pages_manage_metadataisn't listed, you need to re-authenticate the user with this scope included in your auth flow.
2. Your User Isn't an Internal Test User/Role Holder
Since your app is in Developer Mode, Facebook restricts unapproved permissions to only internal users:
- The app's admins, developers, or testers (listed under Roles in your app dashboard)
- Test users you've created specifically for the app
If you're using a regular personal account (not linked to your app's roles or test user list), you'll hit this error even if the permission is added to your app. Double-check that the account generating the token is in one of these allowed groups.
3. The Permission Isn't Added to Your App's Review List
Even in Developer Mode, you need to add permissions to your app's "Permissions and Features" list before you can use them (you don't need to submit for public review, just add them):
- Go to your app's Dashboard → App Review → Permissions and Features
- Search for
pages_manage_metadataand click "Add" if it's not already there. Fill out the basic details (Facebook requires this even for internal testing)
4. Minor Tweaks to Your API Calls
A couple of small adjustments might help resolve edge cases:
- For page creation: While
EDU_SITEis a validcategory_enum, try using the numeric category ID instead (you can fetch valid IDs via thepage_categoriesGraph API endpoint). Sometimes enums can have unexpected behavior in Developer Mode. - For cover updates: Instead of using
cover_id, try uploading the cover directly via thecover.sourceparameter with a public image URL, like:
This avoids any potential issues with the{'cover': {'source': 'https://your-domain.com/your-cover-image.jpg'}, 'offset_x': 50, 'offset_y': 39, 'access_token': '...'}cover_idnot being owned by the page/user you're acting as.
Give these steps a shot, and if you still run into trouble, let us know what you find in the token debugger or app settings—we can narrow it down further!
内容的提问来源于stack exchange,提问作者P.S.

