The Unit Offers in Given Course Offer endpoint allows your applications to get information about unit offers in a course offer.
Get All Unit Offers in a Course Offer
GET /courseoffers/courseoffer/{id}/unitoffers
Returns the list of Unit Offers in the Course Offer with the specified {id}.
Sample request:
curl -X GET \ -H "Accept: application/vnd.mywisenet.api.v1+xml" \ https://tst-api.wisenet.co/courseoffers/courseoffer/123/unitoffers
Sample response 1:
<UnitOfferSet xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <SetCount>1</SetCount> <Link> <Href>/unitoffers/enrolments</Href> <Rel>enrolments</Rel> <Title>Enrolments</Title> </Link> <UnitOffers> <UnitOffer> <CourseId>1</CourseId> <CourseOfferId>123</CourseOfferId> <CourseOfferLink> <Href>courseoffers/courseoffer/123</Href> <Rel>course-offer</Rel> <Title>1 - 123</Title> </CourseOfferLink> <DeliveryMode></DeliveryMode> <LastUpdated>2011-12-13T09:18:39.12</LastUpdated> <Link> <Href>unitoffers/unitoffer/1</Href> <Rel>self</Rel> <Title>UO1: U1 - CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Title> </Link> <Location> <Description i:nil="true"></Description> </Location> <MaximumEnrolments>30</MaximumEnrolments> <MinimumEnrolments>1</MinimumEnrolments> <Program></Program> <Unit> <Code>U1</Code> <Description>CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Description> </Unit> <UnitEnrolmentsLink> <Href>unitoffers/unitoffers/enrolments</Href> <Rel>enrolments</Rel> <Title>All Unit Enrolments</Title> </UnitEnrolmentsLink> <UnitOfferCode>UO1</UnitOfferCode> <UnitOfferId>1</UnitOfferId> <UnitOfferPeriod> <EndDate>2011-12-03T00:00:00</EndDate> <StartDate>2010-12-03T00:00:00</StartDate> </UnitOfferPeriod> <UnitWebDetails></UnitWebDetails> <UrlEnrol>https://wiseweb2.mywisenet.com.au/wiseweb/login.aspx?key=...</UrlEnrol> <Venue></Venue> <WebDetails> <Name>CERTIFICATE II IN HOSPITALITY (OPERATIONS)</Name> </WebDetails> </UnitOffer> </UnitOffers> </UnitOfferSet>
Sample response 2: An incorrect {id} would return 404 HTTP code.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> The Course Offer with ID '123' cannot be found. </string>
C# Code Sample
private static void ReadSample() { const string url = "https://tst-api.wisenet.co/courseoffers/courseoffer/123/unitoffers"; var request = HttpWebRequest.Create() 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); } }