REST API User Search, Get User Details, Add Users to User Group
I'm new to the Panopto API so I'm unsure of the results that I'm getting. I'm doing a user search and my searchQuery value is an email address. The status I get back is 200, and yet, the results property comes back empty. Shouldn't I get back some user details, or is the status merely telling me that the user exists?
I also did a group search with my searchQuery value as the name of my target User Group. All I got back was the group's ID. I had hoped that it would also tell me which users were part of the group.
Using these two searches, I was attempting to determine if a user was part of a particular group. Is there a way I can do this?
Ultimately, what I need to do is add users to a User Group via the REST API or SOAP. What's the best way to achieve this goal?
User Search Results:
User Group Search Results:
Answers
Hi Alex,
Thank you for contacting Panopto. I am Nedim and I will try to help you to achieve your goal.
For your needs you can use our SOAP API endpoints as follows:
GetUsers - You can search for users by userId and result will contain basic information with included groups where user is member of
GetUserByKey - You can get user by userKey with basic information including where user is member of
AddMembersToInternalGroup - You can add user to the internal or external group. This example is for internal group
Documentation for other SOAP user's endpoints can be found here.
Also, we offer public REST API and endpoints can be found here.
I hope this will help you to achieve your goal.
Please let us know if you have further questions.
Regards.
Thank you so much, Nedim. This is exactly what I needed, the endpoints, the schemas, the required parms...and I appreciate it so much. I will follow-up with my results here.
Hi Nedim
Hoping you can help. This is the response I'm getting from the REST POST when I use the GetUserByKey SOAP Action.
This is the Service URL I'm using: https://smith.hosted.panopto.com/Panopto/PublicAPI/4.0/UserManagement.svc
My HTTP Headers are:
The HTTP Entity, or Request Body looks like this:
I'm not sure what's going on here. Hoping you can shed some light on this for me. Do you think I could use a SOAP Execute rather than a REST Post? Any help you can provide would be greatly appreciated.
Thanks, Alex
Hi Alex,
Can you try with admin user and Panopto Internal provider? If you do not have already that user, you can create a new one, add administrator permissions and try again.
Note: I noticed that Panopto Internal provider is hidden from your Identity Provider dropdown, so once you create a new one with temp pass, you will need to unhide Panopto Internal provider, sign in to your site using created user's username and password which will lead you to enter new password and you will be signed in. After that you can hide again Panopto Internal provider. With that user you should be able to get your needed response.
Also, I am sharing with you screenshots of SOAP API request and response that I used with Postman, so you can verify that you didn't miss some step
Body:
Headers:
Response:
At the end, I am sharing with you our API support document that you can use, too: https://support.panopto.com/s/article/api-0#hTargetInstance1
I hope this will help you.
Please let us know if you have further questions.
Regards.
Nedim
Hi Nedim
Per your instructions, I attempted to create an admin user Internal Provider account, but I was unsuccessful. I didn't see anything that intuitively let me choose an Internal Provider option. I was only able to create another unified user with admin privileges.
When I logged in I did not see any dropdowns that allowed me to unhide Internal Provider.
I tried finding documentation about this on support.panopto.com, but all I found was an article about Internal Provider consolidation.
Could you give me some tips/tricks/instructions on how to create an admin user internal provider?
Thanks, Alex
p.s. thanks for your patience, support, and understanding
Hi Alex,
Here are steps how to create user with internal Panopto identity provider:
Create Admin user
Unhide Panopto internal identity provider
Sing-in to Panopto as a created user
Hide Internal Panopto identity provider
I hope this steps will help you with creating Admin user for Internal Panopto identity provider.
Regards,
Nedim
On my login screen, this is all I see. There isn't an Panopto Internal Identity Provider option in the dropdown. I will check with our lead administrator to see if they can help, unless there's something you can also suggest.
Hi Alex,
"Panopto" is what you need, not Panopto Internal. Sorry, my bad. Friendly description from Identity Provider page is what you will see in the dropdown.
Nedim
Hey Nedim....SUCCESS! Man, that made me feel good. I was able to get the Panopto Internal Identity Provider.
Once I got that, I updated the auth credentials in the GetUserByKey XML request. I used my own personal email address in the userKey parm for this request. I sent the request using Postman, and then I got more SUCCESS! I actually got back what I was expecting.
The problem I have now is if I use any other value in userKey besides my own email address, I get back a blank response. For instance, instead of using [email protected], I use a different email address for someone I know exists and can see them in the UI. But when I send the request using Postman, my response comes back without any results. See below. Why is this? I need to be able to see user profiles in order to determine if they exist in a group. Does my user with Internal Identity Provider need a wider scope that admin does not provide?
Alex
Hi Alex,
I am glad that your GetUserByKey request works now!
Your new created user that you use is Admin so you should be able to get responses from other users.
Are you sure that you are using valid UserKey for some other user?
You can try to use ListUsers SOAP API endpoint and to list your users. Once you do that you can verify what UserKey is related to the user that you need.
ListUsers
I hope this will help you.
Regards,
Nedim
So yeah, it's very strange. I followed your suggestion and executed a ListUsers action. That was successful. I then copy and pasted one of the user email addresses that was included in the response and executed a GetUserByKey action. Even though I received a 200 response code back, there was nothing in the results. So it's the same thing that I encountered before. The only time I get actual results is when I use my own personal email address.
Could it be something with the OAuth2 credentials and configuration I'm using and why results aren't coming back to me?
Response Results:
Here are my headers:
Here's my request body:
OAuth2 Authorization Config:
So I removed the OAuth2, but I still came up with the same results. I can get my user details when using my own email address as the key, but for anyone else's, I get an empty result set.
Hi Alex,
Can you please share with me what user you would like to retrieve with GetUserByKey? I need at least email, first name/last name and user key.
Also, can you share your SOAP request (Header and Body) for user you are trying to retrieve data by GetUserByKey endpoint?
I can try on my side.
Thanks.
Nedim
Hi Nedim, I sent you the information you asked for in a message. I did not want to post names and email addresses (or anything that might be PII data) in a public place. Let me know what you think.
Thank you, Alex
Hi Alex,
Thanks for providing data. I tried and I successfully retrieved data by GetUserByKey.
I sent you more details via message.
I hope that will help you.
Regards,
Nedim
Nedim, thank you for the details you provided in our message. Ensuring that I prefaced the email address with "unified\" made everything work beautifully. I am also able to use the AddMembersToInternalGroup action successfully. Your assistance was instrumental toward helping me achieve success.
Best...