'Posting MP4 Videos to Instagram always returns error code 2207026
I posted an MP4 Video to instagram using the Facebook Graph API for Content Publishing with the below code, but for most of the time I'm getting back the error occurred 2207026 while checking the status of the video.
The code is below:
let mediaContainerUrl = `https://graph.facebook.com/${igUserId}/media`;
let videoURL = `URL Of MP4 Video Hosted on Firebase Storage`;
let containerParams = new URLSearchParams();
containerParams.append('caption', body);
containerParams.append('video_url', videoURL);
containerParams.append('access_token', targetAccessToken);
let mediaContainerResponse = await axios.post(mediaContainerUrl, containerParams);
let { id: mediaContainerId } = mediaContainerResponse.data; //Upload is done here
I now checked the status of the uploaded video using the below code:
let mediaContainerStatusEndpoint = `https://graph.facebook.com/${mediaContainerId}?fields=status_code,status&access_token=${targetAccessToken}`;
let { data: mediaContainerStatus } = await axios.get(mediaContainerStatusEndpoint);
let { status_code, status } = mediaContainerStatus; //Unfortunately, status is most times coming back as `2207026` even for valid videos
So, is there a reason I keep getting back the status code 2207026? Because status code 2207026 means invalid video format. But the video format seems valid to me
Please note that the video is an MP4 and also under 60seconds.
Any ideas on this would be greatly appreciated.
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
