将单张照片上传到7页总是会失败2个特定页面。 OAuthException [code] => 2"

时间:2013-12-05 13:07:44

标签: php facebook facebook-graph-api

将照片上传到我管理的两个页面时,"unexpected error has occurred. Please retry your request later. OAuthException [code] => 2"

失败

我正在使用批量请求上传。我是所有7页的经理。调试访问令牌给了我:

Issued  1385854349 (on Saturday)
Expires Never
Valid   True
Origin  Web
Scopes  create_note, manage_pages, photo_upload, publish_actions, publish_stream, share_item, status_update, user_friends, user_groups, video_upload

我可以将批量请求中的链接发布到所有7个页面,没有错误。当我更改代码以发布照片时,只有2个页面失败。其他5页正确发布单张照片。此外,我尝试使用AlbumID而不是PageID,结果相同。 5传2失败。我也尝试用相同的结果单独发布每个。无论如何,这2页总是失败。有任何想法吗?我可以发布代码,但我不确定这会有所帮助,因为这似乎是服务器端。

`$queries = array(
            array('method' => 'GET', 'relative_url' => '/'.$user),
            array('method' => 'GET', 'relative_url' => '/'.$user.'/accounts?limit=50'),
    );

    try{
            $batchResponse = $facebook->api('?batch='.json_encode($queries), 'POST');
    }catch(Exception $o) {
            error_log($o);
    }

    $user_info  = json_decode($batchResponse[0]['body'], TRUE);
    $pages   = json_decode($batchResponse[1]['body'], TRUE);

                     - Then later - 

`

`                      `foreach ($_POST['ids'] as $id) {

                         foreach($accounts['data'] as $account){
                            if($account['id'] == $id){
                            //echo $id;
                            $ACCESS_TOKEN = $account['access_token'];
                            echo "<p>Page Access Token: $ACCESS_TOKEN</p>";
                         }  
                    }

            //echo $id;
                            $batchPost[] = array('method' => 'POST', 'relative_url' => "/$id/photos?access_token=$ACCESS_TOKEN" , 'body' => http_build_query($body));`

0 个答案:

没有答案