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.

REST API: no result when home folder has no subfolders

Hi all!
We are currently developing a solution for a self-service video studio where videos automatically are uploaded to the correct user based on their Panopto username.

We have successfully used the REST API for this service, but there is another problem that forces us to use the SOAP API as it does not have the function in the REST API. The problem arises when a user for example, runehr has an empty home folder. Using the path /api/v1/folders/search in the REST API we are unable to find runehr home folder, when this folder does not contain any folders.

When looking on runehr MyFolder and it contains no subfolders, we are not able to retrive the Parentfolder ID for the user.

Without having to go great lengths to just create a folder in the runehr personal folder, and then having to wait ?? 10-15minutes before it's visible in the rest API, and THEN get the ParentFolder ID for runehr folder.

BUT since we don't know the ParentFolder ID for the user, we are not able to create the folder and find runehr ParentFolder ID.
This could have been solved if when searching for users in the API with path /api/v1/users/search, it would also return the ID for their MyFolder.

We can solve this using SOAP:
#SOAP API
                AUTH = {
                    "UserKey": settings.PANOPTO_USERNAME,
                    "Password": settings.PANOPTO_PASSWORD
                }
                client = Client(f"https://{settings.PANOPTO_SERVER_HOST}/Panopto/PublicAPI/4.6/SessionManagement.svc?wsdl")
                PersonalFolder = client.service.GetPersonalFolderForUser(auth=AUTH, userId=user_id, allowCreation ="false")
                user_parent_folder_id = PersonalFolder["Id"]

…but then again we can’t use the token, but are forced to use username and password login instead.
Are there anyone that might have a solution for this in the REST API?

 

Have a nice day! :-) 

Best Answer

  • Kevin BaumKevin Baum Panopto Employee
    Answer ✓

    Hi Lukas,

    Once you send the request to the LegacyLogin REST API endpoint with a valid access token and receive the result, you should just need to save the .ASPXAuth cookie that is returned. When you then make a request to the SOAP API, add the value of the .ASPXAuth cookie you saved earlier to the cookie header in the request to the SOAP API, and leave the authentication properties null. That should trigger Panopto to use the cookie you send instead of the user name and password or authcode in the AuthInfo property when calling the SOAP API.

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

    Thanks,

    Kevin

Answers

  • Kevin BaumKevin Baum Panopto Employee

    Hi Rolf,

    Unfortunately, we do not currently have a method to get a user's personal folder using Panopto's Public REST API, but you can use the GetPersonalFolderForUser SOAP API endpoint to get that folder.

    The SOAP API does not currently accept access tokens for authentication, but you can use the LegacyLogin REST API endpoint to get an authorization cookie based on an access token. Once you have a valid authorization cookie from the LegacyLogin endpoint, you can add that to the call to the SOAP API, rather than needing to send the authentication information directly in the call again.

    I have also added a feature request for our REST API to add an endpoint to retrieve a personal folder for a user, but I'm not currently able to give any estimates on when that would be available.

    Please let me know if you have any other questions.

    Thanks,

    Kevin

  • Hi.

    I am trying to make the LegacyLogin in RestAPI work. But how does one use it to authenticate and use the SOAP API afterward?

    Im getting two Cookies:
    .ASPXAUTH and csrfToken

    How do I use it?

Sign In or Register to comment.