我有带有 publish_stream 的应用程序,我可以在我的用户墙上发布状态更新,现在我想发布照片,在搜索后我阅读了 batchrequest 并制作了这样的代码
<?php
require_once('./includes/config.php');
require_once('./includes/skins.php');
require_once('./includes/functions.php');
require_once('./includes/facebook.php');
$app_id = "$appid";
$app_secret = "$appsec";
$sql=mysql_query("select `f_id`, `facebook_access_token` from `users` ");
while($rows = mysql_fetch_array($sql)){
$f_id=$rows['f_id'];
$facebook_access_token=$rows['facebook_access_token'];
$batched_request = '[{"method":"POST", "relative_url":"'.$f_id.'/photos",'
. ' "body" : "message=لو بتحب جاهين و رباعياته اشترك معانا فى التطبيق و هننشرلك على بروفايلك اجمد رباعيات صلاح جاهين http://2lshmaker.uni.me/jahin/", "attached_files":"file1"}}]';
$post_url = "https://graph.facebook.com/" . "?batch="
. Urlencode($batched_request) . "&". $facebook_access_token
. "&method=post";
}
echo ' <form enctype="multipart/form-data" action="'.$post_url.'"
method="POST">';
echo 'Please choose 2 files:';
echo '<input name="file1" type="file">';
echo '<input type="submit" value="Upload" />';
echo '</form>';
?>
但它给了我那个错误
{
"error": {
"message": "Top level access token or app id not specified for batch request.",
"type": "GraphBatchException"
}
}
尽管已经有了 publish_stream 和有效的 access_token,但我不知道我得到了什么