グラフAPIでFacebookに写真を投稿しようとしていますが、投稿できません。このエラーが発生します
配列([エラー] =>配列([メッセージ] =>(#100)無効なパラメーター[タイプ] =>OAuthException[コード]=>100))
これが私のコードです
$sqls= mysql_query($sql);
while($sqlr = mysql_fetch_array( $sqls, MYSQL_NUM ))
{
$users[]= $sqlr['regidfriendsid'];
}
for ($t=0 ; $t<3;$t++)
{
$tag[$t] = array( 'tag_uid' => ($users[$t]), 'x' => (20+$x), 'y' => (85+$y) );
$x=$x+200;
$z++;
if ($z%4==0)
{
$y=$y+178;
$x=0;
}
}
$tag = array($tag[1], $tag[2], $tag[3]);
$tags = json_encode($tag);
print_r($tags);
// end loop for tags
//upload photo
$file= 'styleimage/save_as_this_name.jpg';
$args = array(
'message' => 'My Stylish friends',
'tags' => $tags,
);
print_r($args);
$args[basename($file)] = '@' . realpath($file);
$ch = curl_init();
$url = 'https://graph.facebook.com/me/photos?access_token='.$_SESSION['access_token'];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
//returns the photo id
print_r(json_decode($data,true));
出力
[{"tag_uid":"100003656759153","x":220,"y":85},{"tag_uid":"100004078326378","x":420,"y":85},{"tag_uid":"100000034798548","x":620,"y":85}]@@@@@Array ( [message] => My Stylish friends [tags] => [{"tag_uid":"100003656759153","x":220,"y":85},{"tag_uid":"100004078326378","x":420,"y":85},{"tag_uid":"100000034798548","x":620,"y":85}] )
--Before posting the actual content of tags . Now trying to post ---
Array ( [error] => Array ( [message] => (#100) Invalid parameter [type] => OAuthException [code] => 100 ) )