What is the External ID of a course folder?
In Panopto UI, when you view the "Info" of a course folder, you can see "Course Information" in the "Overview" tab.
It shows the Id of the course in the LMS system as well as some information like the course name.
I would like to find out how to get this information using API.
I see there is a SOAP API called GetFoldersById, but the results of that API do not populate the ExternalID property.
There is also another SOAP API called GetFoldersByExternalId, but I am not sure how to use that, I tried putting the course ID as the folderExternalId, but that doesn't work.
Best Answer
-
Kevin Baum Panopto Employee
Hi Douglas,
GetFoldersWithExternalContextByExternalId
will only return folders with an external ID that was set using our public API, but will not get folders with an external ID if they were provisioned through the LMS.You can instead try calling
GetAllFoldersWithExternalContextByExternalId
, which will also look at folders provisioned through an LMS in addition to those who had an external ID set using our public API. In this example, you'd want to send "73655" as thefolderExternalIds
parameter, and "CanvasTestTest" as theproviderNames
parameter.Please let me know if you have any other questions.
Thanks,
Kevin
0
Answers
Hi Douglas,
Have you tried SessionManagement.GetFoldersWithExternalContextById? That should add the course ID from the LMS to the returned Folder object, in the
ExternalIds
field.Please let me know if that doesn't work, or if you have any other questions.
Thanks,
Kevin
Thanks for your reply Kevin
I gave that a go, but getting this server 500 error.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring xml:lang="en-US">An error occurred deserializing the message. See server logs for details</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
Here is my request body, authCode and password shouldn't be the problem, as that works on my other SOAP calls.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pan="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetFoldersWithExternalContextById>
<tem:auth>
<pan:AuthCode>{{SoapAuthCode}}</pan:AuthCode>
<pan:Password>?</pan:Password>
<pan:UserKey>{{username}}</pan:UserKey>
</tem:auth>
<tem:folderIds>
<!--Zero or more repetitions:-->
<arr:guid>f95ac22d-1f14-4965-8479-ae07007f4134</arr:guid>
</tem:folderIds>
</tem:GetFoldersWithExternalContextById>
</soapenv:Body>
</soapenv:Envelope>
Hi Douglas,
Can you check what function is listed in your headers as the SOAPAction? The error I'm seeing seems to indicate a mismatch between the function and the parameters being sent.
Thanks,
Kevin
Thanks for the rely Kevin.
I have made progress on this, but still not fully working.
First I call ISessionManagement.GetFoldersWithExternalContextById to get an idea of what format External IDs look like.
This API is working fine, I can pass in a Panopto Folder ID as input. Looks like this.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pan="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetFoldersWithExternalContextById>
<tem:auth>
<pan:AuthCode>{{SoapAuthCode}}</pan:AuthCode>
<pan:Password>?</pan:Password>
<pan:UserKey>{{username}}</pan:UserKey>
</tem:auth>
<tem:folderIds>
<arr:guid>bafcdb2e-51e1-41bc-bc75-ae220077608a</arr:guid>
</tem:folderIds>
</tem:GetFoldersWithExternalContextById>
</soapenv:Body>
</soapenv:Envelope>
Part of the response looks like this:
<a:ExternalIds xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<b:string>CanvasTestTest\73655</b:string>
</a:ExternalIds>
CanvasTestTest is the identity provider name, and 73655 is the Canvas Course ID. So that is great, it's what I expect to see.
Now I want to do the reverse, I want to pass in 73655 and get the Panopto Folder object back. by calling this API.
ISessionManagement.GetFoldersWithExternalContextByExternalId
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pan="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetFoldersWithExternalContextByExternalId>
<tem:auth>
<pan:AuthCode>{{SoapAuthCode}}</pan:AuthCode>
<pan:Password>?</pan:Password>
<pan:UserKey>{{username}}</pan:UserKey>
</tem:auth>
<tem:folderExternalIds>
<arr:string>CanvasTestTest\73655</arr:string>
</tem:folderExternalIds>
</tem:GetFoldersWithExternalContextByExternalId>
</soapenv:Body>
</soapenv:Envelope>
But I get back this response no matter what I put in as the folderExternalId, I tried two folders.
The SOAP message should be valid this time, since I am getting a SOAP message back rather than the blank response I would get if I sent the invalid request.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetFoldersWithExternalContextByExternalIdResponse xmlns="http://tempuri.org/">
<GetFoldersWithExternalContextByExternalIdResult xmlns:a="http://schemas.datacontract.org/2004/07/Panopto.Data.Server.Services.PublicAPI.V46" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
</GetFoldersWithExternalContextByExternalIdResponse>
</s:Body>
</s:Envelope>
I don't know what else I am doing wrong.
Thanks
Doug
Yey, GetAllFoldersWithExternalContextByExternalId is what I wanted, thank you so much.
Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pan="http://schemas.datacontract.org/2004/07/Panopto.Server.Services.PublicAPI.V40" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:GetAllFoldersWithExternalContextByExternalId>
<tem:auth>
<pan:AuthCode>{{SoapAuthCode}}</pan:AuthCode>
<pan:Password>?</pan:Password>
<pan:UserKey>{{username}}</pan:UserKey>
</tem:auth>
<tem:folderExternalIds>
<arr:string>73655</arr:string>
</tem:folderExternalIds>
<tem:providerNames>
<arr:string>CanvasTestTest</arr:string>
</tem:providerNames>
</tem:GetAllFoldersWithExternalContextByExternalId>
</soapenv:Body>
</soapenv:Envelope>