Welcome to the Panopto Community

Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.
Options

Guidance on Adding Captions via the Rest API

I'm not seeing much documentation on how to attach a caption file to a session via the API. I'm able to do it through PostMan with form-data file. I have a few questions:

1. Is it possible to send as text rather than a file? Do I just base64 encode the vtt file contents and send that?

2. Can I overwrite an existing transcript? Right now I receive errors stating "only a single file is allowed"

3. How do I specify which language the caption file is in?

TIA

Answers

  • Options
    Kevin BaumKevin Baum Panopto Employee

    Hi Adam,

    1. Both the SOAP API and REST API endpoints for uploading captions to a session expect a file rather than a stream of text.
    2. If you are using the SOAP API, you can use the ISessionManagement.ReplaceMachineCaptionsAndUploadTranscript endpoint to replace the Panopto Automatic Machine Captions with the newly uploaded caption file. The REST API does not currently allow replacing existing captions, however.
    3. If you are using the REST API to upload captions to a session or to upload captions to a specific stream in a session, you can specify the language in the language parameter of the form post. The SOAP API does not allow you to specify a language, and any captions uploaded using the SOAP API will be in the default language. The REST API will also allow you to upload multiple caption files, as long as they are all different languages. You are still limited to only a single caption file per language, and the API will not replace any existing captions.

    I hope this helps. Please let me know if you have any other questions.

    Thanks,

    Kevin

  • Options

    I'm sure it's obvious, but I can't figure out where to actually specify the language in the body of the post call. Where would I add that in this call:

    {
    "$content-type": "multipart/form-data",
    "$multipart": [
    {
    "headers": {
    "Content-Disposition": "form-data; name=""; filename="testingtranscription.srt",
    "Content-Type": "text/plain"
    },
    "body": "@{outputs('ComposeContent3')}"
    }
    ]
    }

Sign In or Register to comment.