如何发送一些消息/请求facebook用户从php


How to send some messages/request to facebook users from php

我有一个用户(他的朋友user_id)发送的facebook user_id的数量我必须向他们所有人发送消息/应用程序请求。我该怎么做呢?

有任何教程或解决方案,请帮助我

facebook开发者有样例脚本(也适用于PHP)。比如,你试过这个吗?php中pp生成的样例请求如下

<?php 
  $app_id = YOUR_APP_ID;
  $app_secret = YOUR_APP_SECRET;
  $token_url = "https://graph.facebook.com/oauth/access_token?" .
    "client_id=" . $app_id .
    "&client_secret=" . $app_secret .
    "&grant_type=client_credentials";
  $app_access_token = file_get_contents($token_url);
  $user_id = THE_CURRENT_USER_ID;
  $apprequest_url ="https://graph.facebook.com/" .
    $user_id .
    "/apprequests?message=’INSERT_UT8_STRING_MSG’" . 
    "&data=’INSERT_STRING_DATA’&"  .   
    $app_access_token . “&method=post”;
  $result = file_get_contents($apprequest_url);
  echo(“Request id number: ”, $result);
?>