我在这里关注Facebook文档https://developers.facebook.com/docs/video-api/guides/publishing/将视频发布到特定的Facebook页面,但我不断收到错误。
这是我的代码:
try {
let mediaPostParams = new URLSearchParams();
let mediaUploadPath = `https://graph.facebook.com/${pageId}/videos`
mediaPostParams.append('url', "www.somelocationwherevideoishosted.com/vido.mp4");
mediaPostParams.append('access_token', pageAccessToken);
let response = await axios.post(mediaUploadPath, mediaPostParams);
}
catch (e) {
console.log(e); //I keep getting the error message: 'www-authenticate': 'OAuth "Facebook Platform" "invalid_request" "There was a problem uploading your video file. Please try again."',
}
我一直收到的就是这个错误:
'www-authenticate': 'OAuth“Facebook Platform”“invalid_request”“上传视频文件时出现问题。请重试。”',
我不知道我错在哪里。
任何见解将不胜感激。 谢谢你。
我不知道为什么它会引发身份验证错误,但我有一个建议:
file_url
获取参数。url
应以http://
或https://
开头。https://graph.Facebook.com/v11.0/me/videos?access_token=<PAGE_ACCESS_TOKEN>&file_url=<URL>&description=<DESCRIPTION>&published=true
我认为你应该检查给定的范围,这些是所需的范围 页面管理参与度 页面管理帖子 页面阅读参与度 page_read_user_engagement 发布视频, 商业管理