facebook - Permissions to Read Likes via Graph API -
since rest api has gone, need find way read likes pages of our webapp.
according graph api docs, following should return likes object (such page):
https://graph.facebook.com/v2.6/{page-id}/likes?summary=true
oops, an access token required request resource
. turns out, instead of real token, can build ad-hoc token witht app id , secret:
https://graph.facebook.com/v2.6/{page-id}/likes?summary=true&access_token={id}|{secret}
the above returns json payload, however, it's empty though i'm trying page having 200 likes:
{ "data": [ ], "summary": { "total_count": 0, "can_like": false, "has_liked": false } }
maybe permissions problem? app domain , page url domain identical.
big hints solve riddle!
it work simple app access token too, assume wrong idea endpoint. there no way "page fans", can "other pages current page likes" it. try app access token:
https://graph.facebook.com/bladauhu/likes?access_token=appid|appsecret
it should return following json:
{ "data": [ { "name": "fkk scibes skulls", "id": "1391253501090151" }, { "name": "dodgeball austria", "id": "387249994631552" }, { "name": "turbojugend scibes", "id": "105248832848054" }, { "name": "hydra! das endgute satiremagazin.", "id": "167084486537" }, { "name": "vlÜ hydra", "id": "113680962002559" } ], "paging": { "cursors": { "before": "mtm5mti1mzuwmta5mde1mqzdzd", "after": "mteznjgwotyymdayntu5" } } }
more information tokens:
Comments
Post a Comment