WiseNET.API - Student's Unit Enrolments Endpoint

From Wisenet Resource Centre
Jump to: navigation, search


The Wise.NET Student's Unit Enrolments endpoint allows your applications to get information about unit enrolments for a student.

This page is a part of WiseNET API: Developer Resources.

Contents

Related Endpoints

Unit Enrolment Properties

See Unit Enrolments.

List All Unit Enrolments for Student

GET /students/student/{id}/unitenrolments

Returns the list of unit enrolments for the student with the specified {id}.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/student/3/unitenrolments

Sample response:

  <UnitEnrolmentSet xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <EnrolmentsLink>
      <Href>/unitoffers/enrolments</Href>
      <Rel>self</Rel>
      <Title>Enrolments</Title>
    </EnrolmentsLink>
    <SetCount>1</SetCount>
    <UnitEnrolments>
      <UnitEnrolment>
        <CourseEnrolmentId>4</CourseEnrolmentId>
        <LastUpdated>2011-09-23T15:26:51.133</LastUpdated>
        <Link>
          <Href>unitoffers/enrolments/enrolment/4</Href>
          <Rel>self</Rel>
          <Title>Jane Bennet: U4 - CERTIFICATE III IN HOME AND COMMUNITY CARE</Title>
        </Link>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <Student>
          <EmailAddress>jane@bennet.com.au</EmailAddress>
          <FirstName>Jane</FirstName>
          <LastName>Bennet</LastName>
          <LastUpdated>2011-09-23T15:26:51.133</LastUpdated>
          <Link>
            <Href>students/student/3</Href>
            <Rel>self</Rel>
            <Title>STD0000002: Jane Bennet</Title>
          </Link>
          <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000002</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
          <StudentId>3</StudentId>
          <Username>jane@bennet.com.au</Username>
        </Student>
        <UnitEnrolmentId>4</UnitEnrolmentId>
        <UnitOffer>
          <CourseId>0</CourseId>
          <CourseOfferId>4</CourseOfferId>
          <EndDate>2011-12-03T00:00:00</EndDate>
          <StartDate>2010-12-03T00:00:00</StartDate>
          <UnitCode>U4</UnitCode>
          <UnitDescription>CERTIFICATE III IN HOME AND COMMUNITY CARE</UnitDescription>
          <UnitOfferCode>UO1</UnitOfferCode>
          <UnitOfferId>4</UnitOfferId>
          <UnitOfferLink>
            <Href>unitoffers/unitoffer/4</Href>
            <Rel>self</Rel>
            <Title>UO1: U4 - CERTIFICATE III IN HOME AND COMMUNITY CARE</Title>
          </UnitOfferLink>
          <UnitOfferWebName i:nil="true"/>
          <UnitWebDescription i:nil="true"/>
          <UnitWebName i:nil="true"/>
          <UrlEnrol i:nil="true"/>
        </UnitOffer>
      </UnitEnrolment>
    </UnitEnrolments>
  </UnitEnrolmentSet>

C# Code Sample

public static void GetUnitEnrolmentsSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/{id}/unitenrolments";
 
    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.Accept = "application/vnd.mywisenet.api.v1+xml";
    request.Method = "GET";
    request.UserAgent = "C# Sample ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    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 Unit Enrolments for Student

GET /students/student/{id}/unitenrolments

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

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

The Unit Enrolments endpoint will filter on the <LastAuditTimestamp> field and enrolled <StudentId> field on 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/unitenrolments

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

Note: We would recommend that all calls to list Unit 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/unitenrolments";
 
    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 ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    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);
    }
}
Personal tools
Namespaces
Variants
Actions
Navigation
Translate
Wisenet Getting Started
Learning Relationship Management
Learner App
Trainer Portal
Wise.NET Portal
CRM
eLearning
Surveys
Finance
Application Integration
Compliance: Australia
Compliance: New Zealand
Developer Resources
Toolbox