I’m trying to alert the access_token
with a simple function but I’m getting undefined
I’m following their syntax but maybe I’m doing something wrong?
javascript
function logMe() {
FB.login(function(){
FB.api('/me/accounts', {fields: 'access_token'}, function(response) {
var accessToken = response.data.access_token;
alert(accessToken);
} );
}, {scope: 'manage_pages'});
}
2
Answers
With luschn response above this is the final answer
With
/me/accounts
, you get an array of pages you manage – not just one entry:This would be the API endpoint to get the access token for a specific page: