Read.Courses.ForPerson

This method allows you to retrieve course properties from courses belonging specific person. If organisation level access is used, only persons belonging to the selected organisations can viewed. Additionally it is possible to include all courses properties or just a basic set of properties. Please note that if you choose to include all properties the performance impact on the server is higher, so only request these properties if you actually need them.

Input parameters

Name

Description

Type

Mandatory/Optional

SiteId

Site where action will be executed.

Integer

Optional

VendorId

VendorId. Currently not used.

Text

Optional

PageIndex

Index of the requested page.

Integer

Optional (defaults to 0)

PageSize

Size of the requested page.

Integer

Optional (defaults to 100)

Id

Identifier of a person entity. Refer to IdType to the impact of this setting.

String

Mandatory

IdType

The type of the identifier specified by Id.

NOTE1: Only courses connected to organisations you have access to will be returned.

NOTE2: If IdType is Username and this user is deleted, return error with message "Person with specified PersonId/PersonSyncKey/Username is not valid."

Enum of:

  • PersonId

  • PersonSyncKey

  • Username

Mandatory

IncludeAdditionalData

If set to true, the result set will contain all course properties. If set to false, the AdditionalData output parameter will always be null.

Boolean

Optional (defaults to false)

Output parameters

Name

Description

Type

CurrentPageIndex

The index of the current page.

Integer

PageSize

The size of the current page.

Integer

Total

The total number of items which meet the input parameters.

Integer

Courses

Array of courses containing one row for each course in the page.

Course[]

  • CourseId

Identifier of the course.

Integer

  • CourseSyncKey

SyncKey of the course.

String

  • CourseCode

Course code.

String

  • CourseTitle

Course title.

String

  • IsFavourite

Returns if the course is marked as favourite.

Boolean

  • OrganisationId

Identifier of the organisation.

Integer

  • OrganisationName

Organisation title.

String

  • OrganisationSyncKey

SyncKey of the organisation.

String

  • LastUpdated

The date at which this course was last updated.

DateTime

  • AdditionalData

Node containing all the additional data. This is only populated if the input parameter IncludeAdditionalData is set to true.

Custom

  • AdditionalData.CourseCredits

The course credits.

String

  • AdditionalData.Created

The date at which the course was created.

DateTime

  • AdditionalData.CreatedByPersonId

The PersonId of the course creator.

Integer

  • AdditionalData.Role

Role in the course

Enum

  • Teacher

  • Student

  • AdditionalData.LastAccessed

The date at which this course was last accessed by requested person

DateTime

  • AdditionalData.IsVisited

Has the user visited the course

  • AdditionalData.TermIds

Array containing the associated term identifiers.

Integer[]

  • AdditionalData.CalendarFeedURL

URL to the calender feed

String

Example #1

<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" xmlns:its1="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities.ReadCourses.ForPerson">
<soapenv:Header/>
<soapenv:Body>
<tem:ReadCoursesForPerson>
<tem:request>
<its1:Id>teacher</its1:Id>
<its1:IdType>Username</its1:IdType>
<its1:IncludeAdditionalData>true</its1:IncludeAdditionalData>
</tem:request>
</tem:ReadCoursesForPerson>
</soapenv:Body>
</soapenv:Envelope>
<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>2014-01-16T10:59:23.726Z</u:Created>
<u:Expires>2014-01-16T11:04:23.726Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<ReadCoursesForPersonResponse xmlns="http://tempuri.org/">
<ReadCoursesForPersonResult xmlns:a="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities.ReadCourses.ForPerson" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CurrentPageIndex xmlns="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities">0</CurrentPageIndex>
<PageSize xmlns="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities">100</PageSize>
<Total xmlns="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Model.ServiceEntities">1</Total>
<a:Courses>
<a:Course>
<a:AdditionalData>
<a:CalenderFeedURL><![CDATA[webcal://localhost/Calendar/CalendarFeed.ashx?LocationType=1&LocationID=1&PersonId=2&CustomerId=1&ChildId=0&Guid=b7bda374da56dcb531ad9eb1cdc1ada3&Culture=nb-NO]]></a:CalenderFeedURL>
<a:CourseCredits>123</a:CourseCredits>
<a:Created>2013-12-05T13:20:13</a:Created>
<a:CreatedByPersonId>2</a:CreatedByPersonId>
<a:IsVisited>true</a:IsVisited>
<a:LastAccessed>2014-01-15T09:50:20</a:LastAccessed>
<a:Role>Teacher</a:Role>
<a:TermIds xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<b:int>2</b:int>
</a:TermIds>
</a:AdditionalData>
<a:CourseCode>source code</a:CourseCode>
<a:CourseId>1</a:CourseId>
<a:CourseSyncKey/>
<a:CourseTitle>FirstTestCourse</a:CourseTitle>
<a:IsFavourite>false</a:IsFavourite>
<a:LastUpdated>2014-01-15T09:47:18</a:LastUpdated>
<a:OrganisationId>1</a:OrganisationId>
<a:OrganisationName>Site</a:OrganisationName>
<a:OrganisationSyncKey>sync_key</a:OrganisationSyncKey>
</a:Course>
</a:Courses>
</ReadCoursesForPersonResult>
</ReadCoursesForPersonResponse>
</s:Body>
</s:Envelope>

Error states

The following cases will return an error:

  • The requested person does not exists.

  • The requested person has been deleted.

  • The requested person exists, but belongs to an organisation the requester does not have access to.