0

I'm trying to get some (I think allowed) information in my app. I have an access token that has the following info:

App ID: <my app id> : iHOUSEListingPoster - Test 001
Type:   User
App-Scoped User ID:   <user id> : Joe Webb
Valid:  True
Scopes: email, pages_show_list, pages_read_engagement, pages_manage_posts, public_profile

I'm trying this:

FB.api( "/me",
        "GET",
        {fields: 'name'},
        function(get_fb_info_response) {
         console.log("Here: ", get_fb_info_response
      });

And getting this error: "Unsupported get request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation"

I have tried with both "/me" and "/me/". And while I want name, picture and email, I tried limiting it to just name, and still. What am I missing here?

2 Answers 2

1

Try this:

FB.api('/me?fields=name', function(response) {
    console.log('me', response);
});

I'm not sure if api function from FB does have this signature you're using.

Edit

After searching at Facebook docs, found that the signature you were using is valid as well. Then, I went to do some tests here. And I was able to reproduce the same error you have mentioned when calling the function like this:

FB.api("/<123>/", "GET", { fields: 'name' }, function(response) {
    console.log('response', response);
});

To fix it, you need to remove < and >, for example:

FB.api("/123/", "GET", { fields: 'name' }, function(response) {
    console.log('response', response);
});

Calling /me and /me/ endpoint returned no error in my test.

In this screenshot you can see the tests I have run directly at my browser's console.

enter image description here

10
  • Thanks, I tried the variations, still getting: "Unsupported get request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation". The chevrons weren't in my actual code, I just use them to surround my "fake" parameters. I'm more confused because your code is working, and my pretty much identical code is not. 8-( Commented Jun 28, 2022 at 20:30
  • Ok, in the Graph Explorer, I tried "me?fields=name". The permissions, per the explorer, are: email pages_show_list pages_read_engagement pages_manage_posts public_profile And I get the exact same error. I'm baffled. Commented Jun 28, 2022 at 22:12
  • Well.. in that case it's probably a permission error. Test your access_token at https://developers.facebook.com/tools/debug/accesstoken and check if you have the public_profile scope. Commented Jun 29, 2022 at 2:05
  • That was my first thought, but the access token, per the access token debugger, has these permissions: email pages_show_list pages_read_engagement pages_manage_posts public_profile Commented Jun 29, 2022 at 15:31
  • 1
    Hey @BenchVue, I use ShareX (getsharex.com) with the multi region mode enabled. Commented Jul 27, 2022 at 13:22
0

Ok, I finally figured out what the problem is/was here (sheepish face). We have a couple of Facebook accounts here at the company. One is the container for my app and it's test app, the other is a more general company account. I was logged into the general company account. When I tried my app, it grabbed some random app from that account, which wasn't the app that matched the access token (which I think is possible wrong on Facebook's part), therefore this error was thrown.

Once I logged into the correct Facebook account, all works as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.