我开始绝望了,我正试图让facebook上传其他用户的视频。我一直在谷歌搜索,尝试一切,但没有成功。我创建了facebook应用程序,将Appl域设置为subdomain.domain.cz,domain.cz和site url设置为https://subdomain.domain.cz。
当我尝试获取视频列表时,我收到零对象。我使用以下代码:
$fb_page_id = "MY FACEBOOK USER ID";
$access_token_temp = "https://graph.facebook.com/oauth/access_token?client_id=MY_APPLICATION_ID&client_secret=MY_APPLICATION_SECRET&grant_type=client_credentials";
$json_token = file_get_contents($access_token_temp);
$decoded = json_decode($json_token);
$access_token = $decoded->{'access_token'};
$fields = "id,title,description,created_time,from,source";
$limit = 5;
$json_link = "https://graph.facebook.com/v2.6/{$fb_page_id}/videos?access_token={$access_token}&fields={$fields}&limit={$limit}&type=uploaded";
$json = file_get_contents($json_link);
$obj = json_decode($json, true);
$feed_item_count = count($obj['data']);
echo "NUMBER OF OBJECTS RETURNED: ".$feed_item_count; // always returns 0