Những code thông dụng cho nhà phát triển facebook.

Tags

          1: API đếm số tin nhắn đã gửi
<?php https://graph.facebook.com/me/threads?limit=50&access_token=?>
                    2: API xóa tin nhắn
<?php https://graph.facebook.com/id_tu_api_dem_tin_nhan?access_token=&method=delete?> 
        3: API lấy danh sách tất cả bạn bè
<?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: API lấy danh sách bạn bè bị block, FAQ
<?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: API lấy danh sách lời mời kết bạn
<br />
<blockquote style="background: rgb(248, 248, 248); border-bottom-width: 0px; border-left: 4px solid rgb(204, 204, 204); border-right-width: 0px; border-top-width: 0px; box-shadow: rgba(0, 0, 0, 0.2) 3px 3px; font-family: &quot;helvetica neue&quot;, helvetica, arial, sans-serif; font-size: 15.4px; font-stretch: inherit; font-style: italic; line-height: 20.02px; margin: 10px 2em; outline: 0px; overflow: auto; padding: 1em; position: relative; quotes: none; vertical-align: baseline;">
<div>
<span style="color: red;"></span></div>
</blockquote>
          6: Graph API search mọi người
&lt;?php https://graph.facebook.com/search?type=user&amp;q=tu_khoa_tim_kiem&amp;limit=gioi_han_toi_da&amp;fields=id,name&amp;access_token=?&gt; 
                     7. Trang facebook 
&amp;lt;?php https://graph.facebook.com/search?type=page&amp;q=tu_khoa_tim_kiem&amp;limit=gioi_han_toi_da&amp;=id,name,icon&amp;access_token=? <div id="crayon-59c73ce55bef1183886664" class="crayon-syntax crayon-theme-sublime-text crayon-font-monaco crayon-os-mac print-yes notranslate crayon-wrapped" data-settings=" minimize scroll-always wrap"> 
 9:scan nhóm đang làm admin+ tham gia.
 &lt;?php https://graph.facebook.com/?method=post&amp;access_token=&amp;batch=[{"method":"GET","relative_url":"me"},+{"method":"GET","relative_url":"me/groups?fields=icon,administrator,name%26limit=5000"}]&amp;include_headers=false?&gt;
                  10: API đếm like trang
&lt;?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)&amp;access_token=?&gt;
         11: API gửi tin nhắn theo list id
&lt;?php https://graph.facebook.com/me/threads?locale=en_US&amp;to=[{"type":"id","id":"4","id":"4"}]&amp;method=post&amp;return_structure=true&amp;message=1&amp;link=2&amp;name=3&amp;picture=4&amp;description=5&amp;access_token=?&gt;
          12: API mời bạn bè thích trang
&lt;?php https://graph.facebook.com/idTrang/invited?method=post&amp;invitee_id=id_can_moi&amp;access_token=?&gt;
           13: API mời tham gia sự kiện
&lt;?php https://graph.facebook.com/idSuKien/invited?method=post&amp;users=id_can_moi&amp;access_token=?&gt;
                    14: API comment tag
&lt;?php https://graph.facebook.com/172689179864813/comments?method=post&amp;access_token=&amp;message=123+@[id_bb:0]+@[id_bb:0]?&gt;
        15: API share post lên tường bạn bè
&lt;?php https://graph.facebook.com/me/feed?method=post&amp;access_token=&amp;message=1&amp;link=2&amp;tags=id_bb,id_bb?&gt;
           16: API share post vào group
<?php https://graph.facebook.com/id_post_can_share/sharedposts?to=id_group&locale=e
                                    Lời kết

Bài Viết Liên Quan

Phản Hồi Độc Giả


Biểu Tượng Cảm XúcBiểu Tượng Cảm Xúc