skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search