Welcome to the Panopto Community

Databricks API

Can we connect Panopto to Databricks to download transcripts and audio files? If so, how?

Tagged:

Answers

  • Hi Noor,

    Yes I think it is possible, we have sessions api that returns information if session has captions and url for download.

    Create a Databricks notebook that has auth + enumerate sessions + download caption/audio + write Delta.

    Thanks,

    Adis

  • where can I get the session API?

  • Also to confirm is oauth or api key?

  • Hi Noor,

    Panopto requires the Client Credentials flow for server-to-server integrations like Databricks.

    • Setup: Go to Panopto Admin > System > API Clients
    • Grant Type: client_credentials
    • Logic: Your notebook should first POST to https://[your-site]/Panopto/oauth2/connect/token to receive a Bearer token

    Use the GET /api/v1/sessions/search or the specific folder enumeration endpoints.

    • Check for Captions: Look for the HasCaptions boolean in the response
    • Retrieve URLs: You’ll need the Id of the session to construct the download path

    Something similar to this:

    import requests
    import pandas as pd

    # 1. Get Token auth_res = requests.post(
    f"https://{panopto_server}/Panopto/oauth2/connect/token",
    data={"grant_type": "client_credentials"},
    auth=(client_id, client_secret)
    )
    token = auth_res.json()["access_token"]
    headers = {"Authorization": f"Bearer {token}"}
    # 2. Get Session Metadata sessions = requests.get(f"https://{panopto_server}/Panopto/api/v1/sessions/search", headers=headers).json()
    # 3. Process and Write
    data_list = []
    for s in sessions['Results']:
    # Logic to download srt/mp3 goes here
    data_list.append({"id": s['Id'], "title": s['Name'], "has_captions": s['HasCaptions']}) df = spark.createDataFrame(pd.DataFrame(data_list))
    df.write.format("delta").mode("append").saveAsTable("panopto_ingestion_log")

    I hope this helps.

    Thanks,

    Adis

Sign In or Register to comment.