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.

Is there a step by step tutorial how to use the API with Python and if so why isn't that pinned

I've read a number of posts, I also tried to make sense with some of the Github stuff, I even opened a support ticket which was simply closed but still I have not been able to find a, to new folks, understandable Python tutorial. Just a simple start that connects and pulls a list of folders would actually be a great help.

Best Answer

  • Kevin BaumKevin Baum Panopto Employee
    Answer ✓

    Hi Michael,

    We do not currently have a step-by-step tutorial for using our public REST APIs, but we do offer a number of examples in Python of using our APIs and getting access tokens using OAuth2.

    I would suggest you look at our API Python Examples project on GitHub for examples of getting an access token and then using it to get a list of folders from the Panopto REST API. There are several examples in that specific project, but I would suggest the following two Python examples specifically:

    Server-Side Web Application Sample

    User Application Sample

    The Server-Side Web Application sample and User Application sample both follow the same steps to get a list of top-level folders from a Panopto site. The Server-Side Web Application sample uses an OAuth2 login through a web browser to allow a user to login directly to Panopto using any of their SSO providers and retrieve an access token that can be used to call the API afterward. The User Application allows you to pass a Panopto user name and password directly to our OAuth2 token endpoint to retrieve an access token without needing a browser.

    Both samples call Panopto's OAuth2 endpoints (using the PanoptoOAuth2 class) to get an access token that can be used for authentication to the Panopto REST API.

    Once they have the token, they add it to the Authorization header of the outgoing requests, then proceed to make a call to Panopto's Folder API to get a list of top-level folders for the site.

    The details for getting the access token are in the same project, in common\panopto_oauth2.py (PanoptoOAuth2 class). This class uses standard OAuth2 calls to get an access token and serves mostly as a wrapper around the Python oauth2 library, as well as caching the tokens for later calls and providing a quick local web server to receive the responses for a Server-Side Web Application.

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

    Thanks,

    Kevin

Answers

  • Hi Kevin, thanks for that. How is it that you don't have a tutorial, is that not being asked for? The examples on Github I did check out before but I have to say that this is also incoherent. One can probably work his way through this but a clearly documented standard way would be much appreciated. The way it is now everyone touching this for the first has to dig through the stuff on Github and spend time on it. You'd save your customers, as a group, a lot of time if you'd updated this. And you don't have to answer questions like mine anymore, that would save your time too :)

Sign In or Register to comment.