Posts tagged with instagram-reels

i wish to find a solution to this issue i have been facing for a long while, trying to publish a reel on instagram. It keeps returning this error: Media upload has failed with error code 2207026 which means its not in the required format, i have tried with countless videos, uploaded them to my google drive and input the link to the video but still the same error, i came across this: Facebook Graph API - Getting error 2207026 when trying to upload video

And also implemented the last suggesstion in my code as shown below:

public String uploadFile(MultipartFile file) {         String extension = StringUtils.getFilenameExtension(file.getOriginalFilename());         var key = UUID.randomUUID() + "." + extension;         String directory = this.fileStorageLocation;         Path newPath = Paths.get(directory).toAbsolutePath().normalize();         try {             Files.createDirectories(newPath);             Path inputFilePath = newPath.resolve(StringUtils.cleanPath(key));             Path outputFilePath = newPath.resolve("output.mp4");             Files.copy(file.getInputStream(), inputFilePath, StandardCopyOption.REPLACE_EXISTING);             executeFFmpegCommand(inputFilePath.toString(), outputFilePath.toString());         } catch (IOException ex) {             Logger.getLogger(FileService.class.getName()).log(Level.SEVERE, null, ex);         }         return key;     }     private void executeFFmpegCommand(String inputFilePath, String outputFilePath) throws IOException {         String ffmpegPath = "C:\\ffmpeg\\bin\\ffmpeg.exe";         String[] ffmpegCommand = {                 ffmpegPath,                 "-i", inputFilePath,                 "-c:v", "libx264",                 "-aspect", "16:9",                 "-crf", "18",                 "-vf", "scale=iw*min(1280/iw\\,720/ih):ih*min(1280/iw\\,720/ih),pad=1280:720:(1280-iw)/2:(720-ih)/2",                 "-fpsmax", "60",                 "-preset", "ultrafast",                 "-c:a", "aac",                 "-b:a", "128k",                 "-ac", "1",                 "-pix_fmt", "yuv420p",                 "-movflags", "+faststart",                 "-t", "59",                 "-y", outputFilePath         };         ProcessBuilder processBuilder = new ProcessBuilder(ffmpegCommand);         processBuilder.inheritIO();         Process process = processBuilder.start();         try {             process.waitFor();             System.out.println("FFmpeg command executed successfully.");         } catch (InterruptedException e) {             throw new IOException("Error executing FFmpeg command: " + e.getMessage(), e);         }     } 

And uploaded the video to my drive and put in the link again, but still the same error, i dont know could be the issue, could someone provide a suggestion or a link to a video that has been tested with, because i dont see what am doing wrong, thanks.

My goal is: I want to schedule a Reel on Instagram and Facebook at a given time (cross-post at same time) via API. Accounts are connected to each other.

If I use the business suite UI I can schedule into both and I see them marked as "cross post"

I want to do the same thing via API.

What I tried

  1. I can publish instagram reel fine using this api https://developers.facebook.com/docs/instagram-api/guides/content-publishing/#reels-posts BUT I see no way of scheduling there
  2. I can schedule or publish Facebook Reel totally fine via the FB GRaph api BUT can't cross-post to instagram at the same time

I can't find any information for the "share to connected" facebook functionality, or cross-posting scheduling the reel at once in both instagram&facebok.

If I schedule Facebook "Reel/Post" via API is not cross-posted. (see below)

I also can't find any way to schedule Instagram Reel via api

NOTE:

I have already connected my instagram and facebook page and can access both as 1 via business suite.

Questions:

  1. How to cross-schedule reel in both instagram and facebook ? To have same functionality as the ui
  2. If point 1 is not possible, at least how to schedule instagram reel so it is posted automatically at a certain date ? I don't see any documented field in the api for this. I read this https://business.instagram.com/blog/instagram-api-features-updates but no information how to schedule a "reel post" at a given time

Thanks in advance