微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php-Facebook视频上传OAuthExecption 200错误

我在编写的应用程序中具有与此类似的代码(位于:Upload video to facebook with php-sdk graph api),但是昨天我开始收到OAuthException错误.我在Facebook页面上寻找了一个简单的视频上传示例进行测试,它返回了相同的200 OAuthException.我尝试修改权限以包括video_upload

建议有人吗?

我刚刚检查了一下,下面的示例来自Facebook有关如何上传视频的页面.这是行不通的.

`
    

$app_id             = "";// SET TO APP ID
$app_secret         = "";// SET TO APP SECRET
$my_url             = "";// SET TO URL
$video_title        = "TITLE FOR THE VIDEO";
$video_desc         = "DESCRIPTION FOR THE VIDEO";
$page_id            = " "; // Set this to your APP_ID for Applications
$code                   = $_REQUEST["code"];

echo '<html><body>';

if(empty($code)) {
    // Get permission from the user to publish to their page. 
    $dialog_url = "http://www.facebook.com/dialog/oauth?client_id="
    . $app_id . "&redirect_uri=" . urlencode($my_url)
    . "&scope=publish_stream,manage_pages";
    echo('<script>top.location.href="' . $dialog_url . '";</script>');
    } else {
// Get access token for the user, so we can GET /me/accounts
$token_url = "https://graph.facebook.com/oauth/access_token?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $app_secret
. "&code=" . $code;
$access_token = file_get_contents($token_url);

$accounts_url = "https://graph.facebook.com/me/accounts?" . $access_token;
$response = file_get_contents($accounts_url);

// Parse the return value and get the array of accounts we have
// access to. This is returned in the data[] array. 
$resp_obj = json_decode($response,true);
$accounts = $resp_obj['data'];

// Find the access token for the page to which we want to post the video.
foreach($accounts as $account) {
    if($account['id'] == $page_id) {
        $access_token = $account['access_token'];
        break;
    }
}

// Using the page access token from above, create the POST action
// that our form will use to upload the video.
$post_url = "https://graph-video.facebook.com/" . $page_id . "/videos?"
. "title=" . $video_title. "&description=" . $video_desc
. "&access_token=". $access_token;

// Create a simple form 
echo '<form enctype="multipart/form-data" action=" '.$post_url.' "  
   method="POST">';
echo 'Please choose a file:';
echo '<input name="file" type="file">';
echo '<input type="submit" value="Upload" />';
echo '</form>';
}
echo '</body></html>';
?>`

我不断收到此错误
{
   “错误”:{
      “ message”:“(#200)应用无权发布到目标”,
      “ type”:“ OAuthException”,
      “代码”:200
   }
}

解决方法:

只想分享好消息.该错误现已解决.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐