haba713
haba713

Reputation: 2687

Why does FB.api('/me/accounts' ...) return an empty array as response?

Why does FB.api('/me/accounts' ...) return an empty array as response?

var access_token = FB.getAuthResponse()['accessToken']; // access_token is ok
FB.api('/me/accounts', 'get', {"access_token":access_token},
  function(response) { /* response is an empty array... why? */ }
);

Upvotes: 1

Views: 1127

Answers (1)

andyrandy
andyrandy

Reputation: 74014

  • Because you don´t manage any Facebook Pages
  • Because you did not authorize with manage_pages - make sure you get asked for managing your Pages in the authorization process

Btw, you don´t need to add the Access Token when using FB.api. One important point of using the JavaScript SDK is that you don´t need to worry about Access Tokens.

Upvotes: 1

Related Questions