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.

How to change ownership after uploading using sessionUpload?

edited October 17 in API

Hi.

I have a case where I have managed to:

  1. Make a folder using an admin account using the API.
  2. Set the permissions in that folder to inherit the top folder (personal folder) permission making the ownership of the folder go to the user
  3. Upload videos using the API to the new folder

But when the user is trying to share the video the Admin account will need to "allow" them to share it as they are somehow the owner of the files. Is there a method to use the API to make a process where I change the ownership of the videos?

Tagged:

Answers

  • okey, while searching a bit i found this: ISessionManagement.UpdateSessionOwner from the soap api.

    I made some code to connect myself to the soap api:

    def legacylogin(self):
    self.auth
    url = f"https://{self.server}/Panopto/api/v1/auth/legacyLogin"
    return self.session.get(url=url) auth = Panopto.legacylogin()

    # Extract the .ASPXAUTH cookie
    aspxauth_cookie = auth.cookies['.ASPXAUTH']

    # Define a custom Requests auth class to include the .ASPXAUTH cookie in the headers
    class PanoptoAuth(AuthBase):
    def __init__(self, token):
    self.token = token

    def __call__(self, r):
    r.headers['Cookie'] = f'.ASPXAUTH={self.token}'
    return r

    # Create a requests session and attach the custom auth handler
    session = requests.Session()
    session.auth = PanoptoAuth(aspxauth_cookie)

    # Create a Zeep transport using the custom session
    transport = Transport(session=session)

    # Initialize the SOAP client with the WSDL and custom transport
    client = Client(f"https://{PANOPTO_SERVER_HOST}/Panopto/PublicAPI/4.6/SessionManagement.svc?wsdl", transport=transport) client.service.UpdateSessionOwner(sessionIds="GUID", newOwnerUserKey="string")

    This code uses the token I get from using the legacylogin to send stuff to soap. but when running I'm getting problems with finding out the "newOwnerUserKey". I am guessing it is the user_id to the user?

    And the "sessionIds" is either one of these that i find on the videos:

    Am I using this right? or is this only made for Folders? And how do i find out what to send as "newOwnerUserKey" and "sessionIds"?

Sign In or Register to comment.