facebook graph api if a user has liked a page

2019-09-07 23:12发布

I am trying to use facebook graph api to find out if a user has liked a particular page.This is the query I tried

https://graph.facebook.com/user_id/likes/page_id?access_token="my access token"

I tried the same kind of query to find if two users are friends but its returning empty data set even for that.

https://graph.facebook.com/user_id/frineds/user_id

How should I solve that issue?

1条回答
聊天终结者
2楼-- · 2019-09-07 23:34

You can use

GET /v2.2/{user-id}/likes/{page-id}

to find out if a user likes a page. Remember that you need the user_likes permission!

See

For seeing if a user is a friend of another user, try

GET /v2.2/{user-id-a}/friends/{user-id-b}

You need the user_friends permission to do so.

查看更多
登录 后发表回答