I am following the facebook docs here https://developers.facebook.com/docs/video-api/guides/publishing/ to publish a video to a particular facebook page but I keep getting errors.
Here is my code:
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."',
}
All I keep getting is this error:
'www-authenticate': 'OAuth "Facebook Platform" "invalid_request" "There was a problem uploading your video file. Please try again."',
I have no idea where I am going wrong.
Any insights would be greatly appreciated. Thank you.
I don't know why it throws an Authenticate error but i have a suggest:
file_url for param.url of video should start with http:// or https://.https://graph.Facebook.com/v11.0/me/videos?access_token=<PAGE_ACCESS_TOKEN>&file_url=<URL>&description=<DESCRIPTION>&published=true