I am using nodejs to make an api call to add captions to the uploaded video. The response I am getting is success but the captions are not available on the video.

The video is uploaded using {{fb_page_id}}/videos. It returns me a videoId of posted video. Once the video is posted, I am calling {{video_id}}/captions endpoints with caption_file as path to my local file of subtitles. The filename is in the correct format of filename.locale.srt.

Here's the documentation link for captions upload https://developers.facebook.com/docs/graph-api/reference/video/captions/

While using the curl, It is working fine. Here's the curl I am using curl -F 'captions_file=@\"${subtitleFilePath}\"' -F 'method=POST' 'https://graph-video.facebook.com/v19.0/1109093056874668/captions?access_token={{access_token}}&default_locale=none&locales_to_delete=[]'

Looking how to make this request using something like axios, or nodejs-request

Tag:node.js, facebook, facebook-graph-api, subtitle, video-subtitles

Add a new comment.