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.
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
0
Answers
Hi Adam,
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 thedefault
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
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')}"
}
]
}
Hi Adam,
The language should be sent as part of the multi-part form data that you would send in your request. I'm not sure which language you are using, but you can see a raw HTTP sample below:
This shows a sample request with both the file data containing the captions and the language in the multi-part form data of the body of the request.
I hope that this helps. Please let me know if you have any other questions.
Thanks,
Kevin