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.