Panopto API 001: Connecting to the server

Return to the Panopto API index page

In this first example we’re going to connect to the Panopto server using a username and password.

Firstly you will need to connect to your Panopto server and add a new user. In this example I used the username “api” and the password “s2ezupajePhasaP5

The Panopto create user screen from Settings > Users

Once the user exists you will need to give it some permissions. You should give the user only the permissions it needs. If you are using a development server then I’d recommend making it an administrator when following these instructions.

Click settings and set the role to administrator

Click settings under the API user to change its permissions

You’ll find these settings under “Roles”

We now have a user that can connect to the server. Horray!

Open Visual Studio and create a new Command Line C# application

If you’d like to copy and paste my example code I recommend calling your application

If everything has gone to plan you should have some code like this

This is all fine, but the reason to use C# is that it knows all the possible commands that Panopto accepts. So we need to add the services to our application.

Right click on ConsolePanoptoAPI (or your application name) and select Add Service Reference

Add a service reference

A screen will pop up asking you for an address. You’ll need to enter the following

https://[your panopto server here]/Panopto/PublicAPI/4.2/Auth.svc?wsdl

For example, if your server is then put into the address box. Press Go

Add your server then press go

Some services should appear in the box. Before you finish type

into the Namespace box

The namespace that will be used in the project

If everything has worked correctly you’ll see PanoptoAuth in the solution explorer

Panopto Auth is under Service References

We can now use this simple service reference. Put this code between the curly brackets of static void Main(string[] args) {}

These are the log in details we made earlier. You’ll need this sessionAuthInfo within all the other commands we make

We could carry on writing PanoptoAuth. in front of our commands, but we can write

At the top of the console application to tell visual studio to expect commands from that namespace.

You may have noticed when adding the service reference that Auth has a very small amount of commands within it (which is why I’ve used it first). One of those commands is GetServerVersion and we can use it now.

Add the following code after the }; of PanoptoAuth.AuthenticationInfo

Lets start at the bottom and work up.

This makes the command prompt window wait for you to type something in. It simply makes it so that the window doesn’t close a few milliseconds after you run your program.

Console.WriteLine outputs whatever is within the brackets

So how did I know that this command existed? Well if you double click on PanoptoAuth in the Solutions Explorer you’ll see the commands that are available. You’ll also notice that GetServerVersion is under IAuth.

The object browser shows all the functions available

IAuth iAuth = new AuthClient();
Finally the structure above tells which object we need to make and the class of the object.

Finally we run the program and get our output

The output after running our program

Our code now looks like this


Official documentation for IAuth | AuthenticationInfo | GetServerVersion

Return to the Panopto API index page


  1. Graham

    You may have noticed that we define the sessionAuthInfo, but don’t actually use it in our GetServerVersion() command. This is because GetServerVersion doesn’t need authentication.

    Despite this I like the code because
    a) AuthenticationInfo is something you’ll need in all your code
    b) The simple string it returns is the closest thing to a “Hello World”

    What you should be aware of is that the API hasn’t actually checked your username and password works yet.

    8 years ago
  2. Roger Cantillo

    Hi Graham, any chance the API has been extended to support REST?

    5 years ago
  3. Mark

    Hi Graham,

    Do you know if it is possible to connect to the Panopto API in a simple way via the Postman app for example?

    3 years ago
  4. Phillip Holmes

    Hi Graham, when I ran this code I got a System.InvalidOperationException ‘An endpoint configuration section for contract ‘PanoptoAuth.IAuth’ could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration.
    You may want to add a comment to allow people to quickly resolve this issue. Regards, Phil.

    6 months ago
  5. Phillip Holmes

    p.s. The ‘more than one endpoint’ error turned out to just be a duplicate entry of the service in the App.Config file. Just deleted the second entry and it fixed this error. Regards, Phil.

    6 months ago

Leave a Reply

Your email address will not be published. Required fields are marked *