12/01/2016

Một số Graph API Facebook cho người phát triển

  No comments
Sau đây mình xin chia sẻ những Graph API của Facebook cho các bạn muốn phát triển website tiện ích.

------------------------------------------------------------------------------------------------------------
1.Đếm số tin nhắn đã gửi
 PHP Code:

<?php
https
://graph.facebook.com/me/threads?limit=50&access_token=?>
2.Xóa tin nhắn
 PHP Code:

<?php
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è
 PHP Code:

<?php
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ị block, faq
 PHP Code:

<?php
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
 PHP Code:

<?php
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
 Mọi người
 PHP Code:

<?php
https
://graph.facebook.com/search?type=user&q=tu_khoa_tim_kiem&limit=gioi_han_toi_da&fields=id,name&access_token=?>
Trang
 PHP Code:

<?php
https
://graph.facebook.com/search?type=page&q=tu_khoa_tim_kiem&limit=gioi_han_toi_da&=id,name,icon&access_token=?>
 Nhóm
 PHP Code:

<?php
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óm đang làm admin+tham gia
 PHP Code:

<?php
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
 PHP Code:

<?php
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
 PHP Code:

<?php
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=?>    

No comments :

Post a Comment