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.
Options

GetSessionsById() throws exception

Hi.

Whenever I call ISessionManagement.GetSessionsById() with a Session ID, it throws an error. If I call the method using a so called Delivery ID, it works fine. Is this to be expected?

"Invalid Session Id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx for user: nnnnnnnn:xxxxxxxx, at accessLevel: "The current user does not have access to call this method."

The user has admin access.

I found a workaround by searching the Session ID using GetSessionsList(), but the other method would be an easier and safer approach.

Thanks for any insight or advice.

Tagged:

Best Answer

  • Options
    Kevin BaumKevin Baum Panopto Employee
    Answer ✓

    Hi Vegard,

    Yes, you should be using the Delivery ID when calling GetSessionsById(), rather than the Session ID if you are getting the ID from the Panopto Web application. That can be a point of confusion, but all of our APIs that have a Session ID parameter are actually referencing the Delivery ID.

    If you are using another API call to get the session list (such as GetSessionsList()), the ID returned for each session will be the Delivery ID, and is the correct ID for any further API calls that require a session ID.

    Please let me know if you have any other questions.

    Thanks,

    Kevin

Answers

  • Options

    I got told the same thing when having a nice talk with a Panopto employee. Seems there are some historical reasons for this. It's confusing when you don't know, but now all's good, thanks!

  • Options

    I have same problem.

    If I call GetSessionsById() passing a sessionID (that I have stored into an external data base) of a session that doesn't exist anymore I get same exception.

    "Invalid Session Id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx for user: nnnnnnnn:xxxxxxxx, at accessLevel: "The current user does not have access to call this method."

    GetSessionsById() normally return the list of Sessions (IEnumerable<session>) with ID in the Guid[] array passed as parameter.

    In this case (session that doesn't exist) , why the API doesn't return a list without the deleted session (or empty list if I passed just 1 Guid) but it cause an exception instead?

    The only solution is to get the complete List of all existing sessions and check if my session is still present?

    Thanxs

    Roberto

  • Options

    Late reply, sorry for that, but I came across your answer by coincidence just now. I tried duplicating your scenario and I get the same result. Trying to retrieve sessions by using GetSessionsById() , if one or more of the supplied Delivery IDs doesn't exist (like if deleted), the method will throw an exception instead of returning the sessions that actually do exist.

    I suppose if you can tolerate asking for just one session per call, you can catch the exception and remove it from your list of IDs to check. In the end you'd have a list of valid sessions.

Sign In or Register to comment.