Loading...

OLD API Endpoint: Student’s Course Enrolment

In September 2018 Wisenet released a beta version of a new API named Wisenet API. This became live in December 2018. The Wisenet API is a complete rewrite and is designed to replace the now named OLD API. While we will be keeping the OLD API active for at least a year, it will no longer be updated.

Go to Wisenet API Docs 

The Wisenet Student’s Course Enrolments endpoint allows your applications to get information about course enrolments for a student.

Course Enrolment Properties

List All Course Enrolments for Student

GET /students/student/{id}/courseenrolments

Returns the list of course enrolments for the student with the given {id}

Sample request:

 curl _X GET \
   -H 'Accept: application/vnd.mywisenet.api.v1+xml' \
   https://tst-api.wisenet.co/students/student/3/courseenrolments

Sample response:

  <CourseEnrolmentSet xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <SetCount>1</SetCount>
    <CourseEnrolments>
      <CourseEnrolment>
        <CourseCode>CO1</CourseCode>
        <CourseEnrolmentId>1</CourseEnrolmentId>
        <CourseOffer>
          <CourseEnrolmentsLink>
            <Href>courseoffers/enrolments</Href>
            <Rel>self</Rel>
            <Title>All CourseEnrolments</Title>
          </CourseEnrolmentsLink>
          <CourseId>0</CourseId>
          <CourseOfferId>1</CourseOfferId>
          <Link>
            <Href>courseoffers/courseoffer/1</Href>
            <Rel>self</Rel>
            <Title>08VUCHO3 - CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Title>
          </Link>
          <OfferCode>08VUCHO3</OfferCode>
          <OfferDescription>CERTIFICATE II IN HOSPITALITY (OPERATIONS)</OfferDescription>
          <UrlEnrol i:nil="true"/>
        </CourseOffer>
        <EnrolmentStatus>
          <Code>1</Code>
          <Description>Cancelled - No Penalty</Description>
        </EnrolmentStatus>
        <LastUpdated>2011-12-13T09:18:39.123</LastUpdated>
        <Link>
          <Href>courseoffers/enrolments/enrolment/1</Href>
          <Rel>self</Rel>
          <Title>STD0000001: 08VUCHO3 - CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Title>
        </Link>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <PeriodEnrolled>
          <EndDate>2011-10-04T00:00:00</EndDate>
          <StartDate>2011-09-04T00:00:00</StartDate>
        </PeriodEnrolled>
        <Student>
          <EmailAddress>fitzwilliam@darcy.com.au</EmailAddress>
          <FirstName>Fitzwilliam</FirstName>
          <LastName>Darcy</LastName>
          <LastUpdated>2011-12-13T09:18:39.123</LastUpdated>
          <Link>
            <Href>students/student/1</Href>
            <Rel>self</Rel>
            <Title>STD0000001: Fitzwilliam Darcy</Title>
          </Link>
          <RefInternal>STD0000001</RefInternal>
          <StudentId>1</StudentId>
          <Username>fitzwilliam@darcy.com.au</Username>
        </Student>
        <StudyMode>
          <Code>FT</Code>
          <Description>Full Time (FT)</Description>
        </StudyMode>
      </CourseEnrolment>
    </CourseEnrolments>
    <Link>
      <Href>/courseoffers/enrolments</Href>
      <Rel>self</Rel>
      <Title>Enrolments</Title>
    </Link>
  </CourseEnrolmentSet>

C# Code Sample

public static void GetCourseEnrolmentsSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/{id}/courseenrolments";

    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.Accept = "application/vnd.mywisenet.api.v1+xml";
    request.Method = "GET";
    request.UserAgent = "C# Sample Client";

    try
    {
        // Get response  
        using (var response = request.GetResponse() as HttpWebResponse)
        {
            // Get the response stream  
            using (var responseReader = new StreamReader(response.GetResponseStream()))
            {
                string responseBody = responseReader.ReadToEnd();

                // Console application output  
                Console.WriteLine(responseBody);
            }
        }
    }
    catch (WebException ex)
    {
        Console.WriteLine("Error: {0}", ex.Message);
    }
}

List modified Course Enrolments for Student

GET /students/student/{id}/courseenrolments

Set the If-Modified-Since header in the HTTP request. The date must be in UTC format.

Returns the list of course enrolments for the specified student {id} created or modified since the specified date.

The Course Enrolments endpoint will filter on the <LastAuditTimestamp> field and enrolled <StudentId> of each enrolment. The <LastAuditTimestamp> field is set to the current UTC date whenever an enrolment is created or edited.

Sample request:

 curl _X GET \
   -H 'Accept: application/vnd.mywisenet.api.v1+xml' \
   -H 'If-Modified-Since: Fri, 8 Jul 2011 1:43:31 GMT' \
   https://tst-api.wisenet.co/students/student/3/courseenrolments

Response format would be the same as for the List All Course Enrolments for Student command.

Note: We would recommend that all calls to list Course Enrolments from the API use this If-Modified-Since parameter.

C# Code Sample

private static void GetIfModifiedSinceSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/3/courseenrolments";

    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.Accept = "application/vnd.mywisenet.api.v1+xml";
    request.IfModifiedSince = DateTime.Now.AddDays(-1);
    request.Method = "GET";
    request.UserAgent = "C# Sample Client";

    try
    {
        // Get response  
        using (var response = request.GetResponse() as HttpWebResponse)
        {
            // Get the response stream  
            using (var responseReader = new StreamReader(response.GetResponseStream()))
            {
                string responseBody = responseReader.ReadToEnd();

                // Console application output  
                Console.WriteLine(responseBody);
            }
        }
    }
    catch (WebException ex)
    {
        Console.WriteLine("Error: {0}", ex.Message);
    }
}

Was this Resource helpful?