Loading...

OLD API Endpoint: Unit Offers in Course Offer

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 Unit Offers in Given Course Offer endpoint allows your applications to get information about unit offers in a course offer.

Unit Offer Properties

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:

   xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    >1>
    >
      >/unitoffers/enrolments>
      >enrolments>
      >Enrolments>
    >
    >
      >
        >1>
        >123>
        >
          >courseoffers/courseoffer/123>
          >course-offer>
          >1 - 123>
        >
        >>
        >2011-12-13T09:18:39.12>
        >
          >unitoffers/unitoffer/1>
          >self>
          >UO1: U1 - CERTIFICATE II IN HOSPITALITY (OPERATIONS)>
        >
        >
           i:nil="true">>
        >
        >30>
        >1>
        >>
        >
          >U1>
          >CERTIFICATE II IN HOSPITALITY (OPERATIONS)>
        >
        >
          >unitoffers/unitoffers/enrolments>
          >enrolments>
          >All Unit Enrolments>
        >
        >UO1>
        >1>
        >
          >2011-12-03T00:00:00>
          >2010-12-03T00:00:00>
        >
        >>
        >https://wiseweb2.mywisenet.com.au/wiseweb/login.aspx?key=...>
        >>
        >
          >CERTIFICATE II IN HOSPITALITY (OPERATIONS)>
        >
      >
    >
  >

Sample response 2: An incorrect {id} would return 404 HTTP code.

   xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
    The Course Offer with ID '123' cannot be found.
  >

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);
    }
}

Was this Resource helpful?