The Wisenet Course Enrolments endpoint allows your applications to get information about course enrolments and to submit new course enrolments.
Contents
- 1 Related Endpoints
- 2 Course Enrolment Properties
- 3 List All Course Enrolments
- 4 List modified Course Enrolments
- 5 List Course Enrolments page
- 6 List Course Enrolments with Moodle e-learning access enabled
- 7 Add Course Enrolment record
- 8 Adding Course Enrolment Template Checklists
- 9 Minimum JSON to POST a Course Enrolment
- 10 Related Articles
Course Enrolment Properties
The following are mandatory for a PUT / POST request:
- CourseOffer (see Course Offers)
- Student (see Students)
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:
- AACSalesOfficer (maxlength:50)
- AccessedFeeHelp (Specify only “Y” or “N”)
- AdmissionBasis (see dropdowns: AdmissionBasis(FH))
- Agent (Information about an agent: name and code)
- AttendanceType (see dropdowns: AttendanceType (FH))
- CommencingCourseIdentifier (see dropdowns: CommencingCourseIdentifier (AU))
- Deposit (money)
- Duration (allows number to one decimal place e.g. 13.1)
- DurationType (Months or Weeks)
- EnquiryDate (date)
- EnrolmentStatus (see dropdowns: EnrolmentStatus)
- ExpiryDate (date)
- FeeHelpEligible (bit)
- InvoiceNumber (maxlength:20)
- MoodleAccessEnabled (bit)
- MywisenetAccessEnabled (bit)
- NotesPrivate (maxlength:4000)
- PeriodEnrolled (start and end dates)
- StatusReason (custom dropdown: see values defined in app)
- StudyMode (see dropdowns: StudyMode)
- StudyReason (see dropdowns: StudyReason)
- StudyReasonVFH (see dropdowns: StudyReasonVFH (FH))
- TargetGroup (custom dropdown: available in References)
The following are only returned on a GET request and are ignored in POST & PUT:
- CourseCode
- CourseEnrolmentId
- LastUpdated
- Link
List All 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>Agents code</Code> <Description>Agents name</Description> </Agent> <CourseCode>CO1</CourseCode> <CourseEnrolmentId>1</CourseEnrolmentId> <CourseOffer> <CourseEnrolmentsLink> <Href>courseoffers/courseoffers/enrolments</Href> <Rel>enrolments</Rel> <Title>All 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> <MoodleAccessEnabled>true</MoodleAccessEnabled> <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> <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/courseoffers/enrolments"; 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
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 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 Course Enrolments 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/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 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 Course Enrolments page
GET /courseoffers/enrolments?skip={skip}&take={take}
Skips {skip} items in 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 Course Enrolments command.
List 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 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 Course Enrolments command.
Add Course Enrolment record
POST /courseoffers/enrolments
Inserts a 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:
- Course Enrolment ID must be empty
- When adding agent must supply Agent Code and Name
Mandatory fields are Student/StudentId and CourseOffer/CourseOfferId. See 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 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> <RefInternal>STD0000001</RefInternal> <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 Client"; 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 Course Enrolment Template Checklists
POST /courseoffers/enrolments
While inserting a Course Enrolment record into the database you can require to copy 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 Course Enrolment record command – see above.
Minimum JSON to POST a Course Enrolment
{ "CourseOffer": { "CourseOfferId": 1}, "Student": { "StudentId": 24} }