Facebook视频上传OAuthExecption 200错误 [英] Facebook Video Upload OAuthExecption 200 Error

查看:102
本文介绍了Facebook视频上传OAuthExecption 200错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have similar code to this (found at: Upload video to facebook with php-sdk graph api) in an application I wrote, but yesterday I started receiving the OAuthException error. I looked for a simple video upload example to a Facebook page to test, and it returns the same 200 OAuthException. I have tried modifying the permissions to include video_upload

有人建议吗?

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

I just checked and the example below comes from Facebook's page on how to upload videos. It does not work.

`

$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 } }

I keep receiving this error: { "error": { "message": "(#200) App does not have permission to post to target", "type": "OAuthException", "code": 200 } }

推荐答案

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

Just want to share good news. This bug has been solved now.

这篇关于Facebook视频上传OAuthExecption 200错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆