WiseNET.API - Course Enrolments Endpoint

From Wisenet Resource Centre
Jump to: navigation, search


The Wise.NET CourseIn Wise.NET a course is usually a qualification or short course Enrolments endpoint allows your applications to get information about course enrolments and to submit new course enrolments.

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

Contents

Related Endpoints

CourseIn Wise.NET a course is usually a qualification or short course Enrolment Properties

The following are mandatory for a PUT / POST request:

But only CourseOfferId and StudentId fields from the above are used to match student to course offer. So minimal XML for POSTing course enrolment could look like

     <CourseEnrolment xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<CourseOffer>
	    <CourseOfferId>1</CourseOfferId>
	</CourseOffer>
	<Student>
	    <StudentId>1</StudentId>
	</Student>
    </CourseEnrolment>

The following are optional for a PUT / POST request:

The following are only returned on a GET request and are ignored in POST & PUT:

List All CourseIn Wise.NET a course is usually a qualification or short course Enrolments

GET /courseoffers/enrolments

Returns the list of all course enrolments.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/courseoffers/enrolments

Sample response:

  <CourseEnrolmentSet xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <SetCount>1</SetCount>
    <CourseEnrolments>
      <CourseEnrolment>
        <Agent>
           <Code>Agent's code</Code>
           <Description>Agent's name.</Description>
        </Agent>
        <CourseCode>CO1</CourseCode>
        <CourseEnrolmentId>1</CourseEnrolmentId>
        <CourseOffer>
          <CourseEnrolmentsLink>
            <Href>courseoffers/courseoffers/enrolments</Href>
            <Rel>enrolments</Rel>
            <Title>All CourseIn Wise.NET a course is usually a qualification or short course Enrolments</Title>
          </CourseEnrolmentsLink>
          <CourseId>0</CourseId>
          <CourseOfferId>1</CourseOfferId>
          <CourseOfferStatus></CourseOfferStatus>
          <CourseWebDetails></CourseWebDetails>
          <DeliveryMode></DeliveryMode>
          <EnrolViaWiseWebLink i:nil="true"></EnrolViaWiseWebLink>
          <EnrolmentPeriod></EnrolmentPeriod>
          <Link>
            <Href>courseoffers/courseoffer/1</Href>
            <Rel>self</Rel>
            <Title>08VUCHO3 - CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Title>
          </Link>
          <Location>
            <Description i:nil="true"></Description>
          </Location>
          <Offer>
            <Code>08VUCHO3</Code>
            <Description>CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Description>
          </Offer>
          <OfferPeriod></OfferPeriod>
          <Program></Program>
          <PublishPeriod></PublishPeriod>
          <Venue></Venue>
          <WebDetails></WebDetails>
        </CourseOffer>
        <EnrolmentStatus>
          <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>
          <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
          <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/courseoffers/enrolments";
 
    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 CourseIn Wise.NET a course is usually a qualification or short course Enrolments

GET /CourseOffers/enrolments

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

Returns the list of course enrolments created or modified since the specified date.

The CourseIn Wise.NET a course is usually a qualification or short course Enrolments endpoint will filter on the <LastAuditTimestamp> field of each enrolment. This 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/courseoffers/enrolments

Response format would be the same as for the List All CourseIn Wise.NET a course is usually a qualification or short course Enrolments command.

Note: We would recommend that all calls to list CourseIn Wise.NET a course is usually a qualification or short 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/courseoffers/enrolments";
 
    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);
    }
}

List CourseIn Wise.NET a course is usually a qualification or short course Enrolments page

GET /courseoffers/enrolments?skip={skip}&take={take}

Skips {skip} items in CourseIn Wise.NET a course is usually a qualification or short course Enrolments list, then returns {take} items.

You can combine this request with the additional If-Modified-Since header.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/CourseOffers/enrolments?skip=100&take=20

Response format would be the same as for the List All CourseIn Wise.NET a course is usually a qualification or short course Enrolments command.

List CourseIn Wise.NET a course is usually a qualification or short course Enrolments with Moodle e-learning access enabled

GET /courseoffers/enrolments?MoodleAccessEnabled=true&skip={skip}&take={take}

or

GET /courseoffers/enrolments?MoodleAccessEnabled=false&skip={skip}&take={take}

Skips {skip} items in CourseIn Wise.NET a course is usually a qualification or short course Enrolments list, then returns {take} items that have required value of MoodleAccessEnabled.

You can combine this request with the additional If-Modified-Since header.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/CourseOffers/enrolments?MoodleAccessEnabled=true&skip=100&take=20

Response format would be the same as for the List All CourseIn Wise.NET a course is usually a qualification or short course Enrolments command.

Add CourseIn Wise.NET a course is usually a qualification or short course Enrolment record

 POST /courseoffers/enrolments

Inserts a CourseIn Wise.NET a course is usually a qualification or short course Enrolment record into the database.

Notes: The GET message contains content that cannot just be sent back in the POST / PUT eg. <CourseEnrolmentSet>.

POST / PUT can only be made individually per record and not in batch, so the request body would start with "<CourseEnrolment", please see for example below.

Restrictions:

Mandatory fields are Student/StudentId and CourseOffer/CourseOfferId. See CourseIn Wise.NET a course is usually a qualification or short course Enrolment Properties/mandatory fields for a PUT / POST request

The Location header in the HTTP response will indicate the URI of the newly created CourseIn Wise.NET a course is usually a qualification or short course Enrolment resource.

If you like to receive newly created object back please use reload=true param

POST /courseoffers/enrolments?reload=true

Sample request:

 curl -X POST \
   -H "Content-Type: application/vnd.mywisenet.api.v1+xml" \
   -d @NewCourseEnrolment.xml \
   -v \
   https://tst-api.wisenet.co/courseoffers/enrolments

NewCourseEnrolment.xml:

  <CourseEnrolment xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Agent>
       <Code>Agent's code</Code>
       <Description>Agent's name.</Description>
    </Agent>
    <CourseCode>CO1</CourseCode>
    <CourseOffer>
      <CourseId>0</CourseId>
      <CourseOfferId>1</CourseOfferId>
      <Offer>
        <Code>08VUCHO3</Code>
        <Description>CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Description>
      </Offer>
    </CourseOffer>
    <EnrolmentStatus>
      <Description>Cancelled - No Penalty</Description>
    </EnrolmentStatus>
    <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>
      <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
      <StudentId>1</StudentId>
      <Username>fitzwilliam@darcy.com.au</Username>
    </Student>
    <StudyMode>
      <Code>FT</Code>
      <Description>Full Time (FT)</Description>
    </StudyMode>
  </CourseEnrolment>

Sample response:

< HTTP/1.1 200 OK
< Date: Mon, 04 Jul 2011 23:34:04 GMT
< Content-Length: 0
< Location: https://tst-api.wisenet.co/CourseOffers/enrolments/2

C# Code Sample

private static void AddSample()
{
    const string url = "https://tst-api.wisenet.co/CourseOffers/enrolments/";
 
    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.ContentType = "application/vnd.mywisenet.api.v1+xml";
    request.Method = "POST";
    request.UserAgent = "C# Sample ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    byte[] byteData = File.ReadAllBytes("NewCourseEnrolment.xml");
 
    // Set the content length in the request headers  
    request.ContentLength = byteData.Length;
 
    // Write data  
    using (Stream postStream = request.GetRequestStream())
    {
        postStream.Write(byteData, 0, byteData.Length);
    }
 
    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("StatusCode: {0}; Response body:{1}", response.StatusCode, responseBody);
            }
        }
    }
    catch (WebException ex)
    {
        Console.WriteLine("Error: {0}", ex.Message);
    }
}

Adding CourseIn Wise.NET a course is usually a qualification or short course Enrolment Template Checklists

 POST /courseoffers/enrolments

While inserting a CourseIn Wise.NET a course is usually a qualification or short course Enrolment record into the database you can require to copy CourseIn Wise.NET a course is usually a qualification or short course Enrolment Template Checklists.

When X-WIS-CopyOfferChecklist HTTP Header is specified, Template Checklists will be copied into enrolment.

All other parameters are the same as for Add CourseIn Wise.NET a course is usually a qualification or short course Enrolment record command - see above.


Minimum JSON to POST a CourseIn Wise.NET a course is usually a qualification or short course Enrolment

{ 
"CourseOffer": { "CourseOfferId": 1}, 
"Student": { "StudentId": 24} 
}
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