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.

Get captions from a restricted folder using Panopto API

This is the issue:

We are trying to get captions from a Restricted Panopto folder using the Panopto API. When we make the call to download the captions, we get a “Status 200 OK” but the response is empty.

Here is what we are doing:

  1. We have setup a “User Based Server Application” API client using an ADFS domain account that is an Administrator in Panopto (unified\uue3241). The API client in Panopto is called “VirtualTA-API-Client”.
  2. We created a local user within Panopto (_uue3241) and gave it Administrator site access. We have also added it to the Restricted folder as a Creator.
  3. Our API call is setup to use “Password Credentials” and is using OAuth2 Authorization. It is passing the Client ID and Client Secret from the “VirtualTA-API-Client” AND the credentials for the local _uue3241 user.
  4. Using this we can successfully get to these endpoints:
    1. GET https://kellogg-northwestern.hosted.panopto.com/Panopto/api/v1/folders/{folderID}
    2. GET https://kellogg-northwestern.hosted.panopto.com/Panopto/api/v1/folders/{folderID}/sessions
  5. From the “../sessions” endpoint, we’re grabbing the “CaptionDownloadUrl” and then making a call to get the video captions:
    1. GET https://kellogg-northwestern.hosted.panopto.com/Panopto/Pages/Transcription/GenerateSRT.ashx?id={captionID}&language=English_USA
    2. This is where we get a “Status 200 OK” but the Response body is empty. We are expecting this to contain the captions text.

This is an issue only for the Restricted Panopto Folder. We are not having any issues with Public/Organization Panopto Folders.

Answers

  • Kevin BaumKevin Baum Panopto Employee

    Hi Ricky,

    The request to the GenerateSRT.ashx page requires a valid authentication cookie to get the data. If the user is not authenticated, you may see that the body is empty even though the call was made successfully.

    Since you already have an access token for the calls you are making to the Public REST API, you can use that to get a valid authentication cookie, and send it in the Cookie header of the request you are making to get the captions. To do this, you can make a call to the LegacyLogin Public API endpoint, adding the access token in the Authorization header as you would for any other call to the REST API.

    If successful, the contents of the response will be empty, but the response headers should include an .ASPXAuth cookie in it. You can get that cookie and its value from the response of the LegacyLogin API endpoint, and add that to the call you make to GenerateSRT.ashx, which should get you the response you are looking for.

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

    Thanks,

    Kevin

Sign In or Register to comment.