Skip to main content
added 631 characters in body
Source Link

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

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.

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

Source Link

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.