integrate-facebook-graph-api-in-your-project-255B1-255D.jpg

Share Một Vài Graph Api Facebook Hữu Dụng

Graph API là một kiểu đồ thị cho phép bạn lấy được mọi thông tin trên Facebook. Nó bao gồm:
  •  node (nút): Những thứ xuất hiện trên facebook có tương tác như ảnh, post…
  •  edge (cạnh): những kết nối, liên hệ giữa nó.
  •  field (trường/lĩnh vực): thông tin của nó.
Chỉ cần bạn có Token thì có thể lấy được mọi thông tin và điều khiển fb qua token
Hiện tại thì Graph Api  Facebook khá là nhiều , bạn không biết Graph Api  bạn cần sử dụng là gì ? Vậy thì hãy đến bài viết này , mình sẽ chia sẻ một số Graph Api  hãy sử dụng và hữu dụng nhất hiện nay
Mỗi Graph Api  mình đều chú thích tính năng riêng của nó :
1. Đếm số tin nhắn đã gửi :
https://graph.facebook.com/me/threads?limit=50&access_token=
2. Xóa all tin nhắn : 
https://graph.facebook.com/id_tu_api_dem_tin_nhan?access_token=&method=delete
3. Lấy danh sách tất cả bạn bè : 
https://graph.facebook.com/fql?q=SELECT+uid,+name,+friend_count,+subscriber_count+FROM+user+WHERE+uid+IN+(SELECT+uid2+FROM+friend+WHERE+uid1+=+me())++ORDER+BY+rand()+LIMIT+5000&access_token=
4. Lấy danh sách bạn bè bị Rip, Block, FAQ :
https://graph.facebook.com/fql?q=SELECT+id,+can_post,+name+FROM+profile+WHERE+id+IN+(SELECT+uid2+FROM+friend+WHERE+uid1+=+me())+AND+name+=+"Facebook+User"+ORDER+BY+rand()+LIMIT+5000&access_token=
5. Lấy danh sách lời mời kết bạn : 
https://graph.facebook.com/?access_token=&batch=[{"name":+"friendrequests",+"method":"GET",+"relative_url":"v1.0/me/friendrequests?limit=5000"},+{"method":"GET",+"relative_url":"fql?q=SELECT+uid,+name,+mutual_friend_count,+sex+FROM+user+WHERE+uid+IN+({result=friendrequests:$.data[*].from.id})"}]&include_headers=false&method=post
6. Graph Api Search :

     6.1 Mọi Người :
https://graph.facebook.com/search?type=user&q=tu_khoa_tim_kiem&limit=gioi_han_toi_da&fields=id,name&access_token=
     6.2 Trang :
https://graph.facebook.com/search?type=page&q=tu_khoa_tim_kiem&limit=gioi_han_toi_da&=id,name,icon&access_token=
     6.3 Nhóm :
https://graph.facebook.com/search?type=group&q=tu_khoa_tim_kiem&limit=gioi_han_toi_da&=id,name,icon&access_token=
7. Scan những nhóm đang làm admin và đã tham gia :
https://graph.facebook.com/?method=post&access_token=&batch=[{"method":"GET","relative_url":"me"},+{"method":"GET","relative_url":"me/groups?fields=icon,administrator,name%26limit=5000"}]&include_headers=false
8. Scan nhóm đang tham gia :
https://graph.facebook.com/?method=post&access_token=&batch=[{"method":"GET","relative_url":"me"},+{"method":"GET","relative_url":"me/groups?fields=icon,administrator,name%26limit=5000"}]&include_headers=false
9. Đếm like trang :
https://graph.facebook.com/fql?q=SELECT+page_id,+name,+fan_count,+access_token+FROM+page+WHERE+page_id+IN+(SELECT+page_id+FROM+page_admin+WHERE+uid+=+me()+ORDER+by+rand()+LIMIT+5000)&access_token=
10. Gửi tin nhắn theo list id đã cài sẵn :
https://graph.facebook.com/me/threads?locale=en_US&to=[{"type":"id","id":"4","id":"4"}]&method=post&return_structure=true&message=1&link=2&name=3&picture=4&description=5&access_token=
11. Mời thích trang :
https://graph.facebook.com/idTrang/invited?method=post&invitee_id=id_can_moi&access_token=
12. Mời tham gia sự kiện :
https://graph.facebook.com/idSuKien/invited?method=post&users=id_can_moi&access_token=
13. Comments tag bạn bè :
https://graph.facebook.com/172689179864813/comments?method=post&access_token=&message=123+@[id_bb:0]+@[id_bb:0]
14. Share Post nên tường bạn bè :
https://graph.facebook.com/id_bb/feed?locale=en_US&method=post&return_structure=true&message=tin_nhan&link=Link_share&name=tieu_de_link&picture=link_anh&description=mo_ta&caption=trang_muon_fake&access_token=
15. Share tag bạn bè :
https://graph.facebook.com/me/feed?method=post&access_token=&message=1&link=2&tags=id_bb,id_bb
16. Share post group :
https://graph.facebook.com/id_post_can_share/sharedposts?to=id_group&locale=en_US&method=post&return_structure=true&message=tin_nhan&access_token=
 Và đó là toàn bộ Graph Api hữu dụng nhất hiện nay mà mình muốn chia sẻ . Bạn nào biết Graph Api nào hay hơn thì chia sẻ nhé .
Luôn theo dõi bài viết nhé . Mình sẽ luôn cập nhập Graph Api mới
Lưu Ý : Token để sử dụng các Graph Api trên là token IOS với token htc
Lời Kết : Chúc các bạn tìm kiếm được Graph Api mình mong muốn qua bài viết này 
Tồng Hợp Api : Vutienanh.pro