Upload video to Facebook album

I created an album on Facebook and have an album ID. I can upload a photo to an album using API / photos. But I can’t upload the video using something like the video API. I get an error message:

"(# 200) The user does not have permission to send to the destination address

1) Is it even a supported API call? I could not find much on the Facebook developer site. 2) Is this a problem with resolution? I have publish_stream, photo_upload, video_upload, user_photos, user_videos all requested. I don’t know if photo_upload / video_upload is even correct, but I saw examples from other sites about photo_upload, so I just suggested that there might be video_upload.

+5
source share
1 answer

Yes, you can upload videos.

Make sure you send the message to the place where you have permission to do so. You can see an example with the code http://developers.facebook.com/blog/post/493/

extracted below:

<?php 
$app_id = "YOUR_APP_ID";
$app_secret = "YOUR_APP_SECRET"; 
$my_url = "YOUR_POST_LOGIN_URL"; 
$video_title = "YOUR_VIDEO_TITLE";
$video_desc = "YOUR_VIDEO_DESCRIPTION";

$code = $_REQUEST["code"];

if(empty($code)) {
   $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" 
     . $app_id . "&redirect_uri=" . urlencode($my_url) 
     . "&scope=publish_stream";
    echo("<script>top.location.href='" . $dialog_url . "'</script>");
}

$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);

$post_url = "https://graph-video.facebook.com/me/videos?"
    . "title=" . $video_title. "&description=" . $video_desc 
    . "&". $access_token;

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>';
?>
-1
source

All Articles