Facebook Graph Places Search API调用持续返回33错误码咨询
Hey there, let's figure out why you're hitting that (#33) OAuthException when trying to use Places Search. That error typically means either your request is missing something critical, or your app/token doesn't have access to the endpoint. Here's how to fix it step by step:
Add a valid API version to your request
Facebook regularly deprecates old API versions, and the unversioned endpoint (which defaults to an older version) might no longer support Places Search for user tokens. Append a recent stable version (likev18.0—check Facebook's official docs for the latest) to your URL:https://graph.facebook.com/v18.0/search?type=place¢er=40.7304,-73.9921&distance=1000&q=cafe&fields=name,checkins,website&limit=3&access_token=XXXXCheck your app's mode and test users
If your app is still in Development Mode, most Graph API endpoints only work with test users you've created in your app dashboard. If you're using a regular user's access token (not a test user), that's likely the issue. You have two options:- Switch your app to Live Mode (you'll need to complete basic app verification first), or
- Create a test user in your app's Dashboard > Test Users and use their access token instead.
Validate your access token and permissions
Make sure your token is valid and has the necessary permissions:- Use the Graph API's debug endpoint to check your token:
This will show you if the token is expired, what permissions it grants, and if it's linked to a valid user/test user.https://graph.facebook.com/debug_token?input_token=YOUR_USER_TOKEN&access_token=YOUR_APP_ID|YOUR_APP_SECRET - For Places Search, you'll need at minimum the
user_locationpermission (for user tokens). If you're requesting thecheckinsfield, you'll also need theuser_checkinspermission—this is a reviewed permission, so you'll need to submit your app for approval if you want to use it outside test users.
- Use the Graph API's debug endpoint to check your token:
Ensure the Places product is enabled in your app
Head to your app's Dashboard > Products, and make sure you've added the "Places" product. If it's not enabled, add it and follow the setup prompts—this is required to access Places Search endpoints.Simplify your request to isolate the issue
Try removing thecheckinsfield temporarily to see if the request works:https://graph.facebook.com/v18.0/search?type=place¢er=40.7304,-73.9921&distance=1000&q=cafe&fields=name,website&limit=3&access_token=XXXXIf this succeeds, the problem was the
checkinsfield requiring a permission you don't have yet.
Start with adding the API version first—this is the most common fix for outdated endpoint issues. If that doesn't work, move through the other steps one by one.
内容的提问来源于stack exchange,提问作者zakaria hamdane

