Gets the list of folders and files belonging to the specified course's subdirectory. The course can be selected by specifying the course id or course sync key. The method uses time-based caching of provided results. The cache expires after 30 minutes.

Input parameters

Name
Description
Type
Mandatory/Optional

SiteId

Site where action will be executed.

Integer

Optional

VendorId

VendorId. Currently not used.

Text

Optional

CourseId

Identifier of the course to get the files and folders for.

Integer

Mandatory, when CourseSyncKey is not specified

CourseSyncKey

SyncKey of the course to get the files and folders for.

String

Mandatory, when CourseId is not specified

Path

Path to the directory which contents will be listed. If unspecified, root directory is assumed. Example: /folder1/folder2

String

Optional

Output

Output type. Can be set to 'Element' for listing files only or 'Folder'. If unspecified, all contents are listed.

Enum

Optional

Example request


Sample request for Read.Course.Files
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:its="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities.CourseFile">
<soapenv:Header/>
<soapenv:Body>
<tem:ReadCourseFiles>
<tem:request>
<its:CourseId>55</its:CourseId>
<its:Output>Folder</its:Output>
<its:Path>abc\def</its:Path>
</tem:request>
</tem:ReadCourseFiles>
</soapenv:Body>
</soapenv:Envelope>

Output parameters

Name
Description
Type

CourseFile

Represents a single course file.

Parent element

CourseFile / Name

Name of the file, including extension.

String

CourseFile / Path

Relative path to the file.

String

CourseFile / URL

URL to the file.

String

CourseFolder

Represents a single course folder.

Parent element

CourseFolder / Name

Name of the folder.

String

CourseFolder / Path

Relative path to the folder.

String

Example response


Sample response for Read.Course.Files.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2012-12-12T12:49:47.562Z</u:Created>
<u:Expires>2012-12-12T12:54:47.562Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<ReadCourseFilesResponse xmlns="http://tempuri.org/">
<ReadCourseFilesResult xmlns:a="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities.CourseFile" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Files>
<a:CourseFile>
<a:Name>1.log</a:Name>
<a:Path>\1.log</a:Path>
<a:Url>https://localhost/data/2/C3/1.log</a:Url>
</a:CourseFile>
</a:Files>
<a:Folders>
<a:CourseFolder>
<a:Name>A</a:Name>
<a:Path>\A</a:Path>
</a:CourseFolder>
</a:Folders>
</ReadCourseFilesResult>
</ReadCourseFilesResponse>
</s:Body>
</s:Envelope>

Error states

In the following cases the service will return an error:

  • The requested course does not exist.
  • The requested course has been deleted.
  • The requested course exists, but belongs to an organisation the requester does not have access to.
  • Course does not have "Use files in course" setting activated.
  • The specified path does not exist within a course.
  • The requester supplied both a CourseId and CourseSyncKey.

Example error message response

Sample Read.Course.Files error message response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2012-12-10T08:50:38.477Z</u:Created>
<u:Expires>2012-12-10T08:55:38.477Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring xml:lang="nb-NO">Course with specified CourseId/CourseSyncKey is not valid.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>