WiseNET API - Student Endpoint

From Wisenet Resource Centre
Jump to: navigation, search


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

The Wise.NET Students endpoint allows your applications to get information about students, add new students, update their details. Also It allows to get student's course and unit enrolments.

Contents

Related Endpoints

Student Properties

If using xml serialization please order the properties alphabetically.

In the field list below for string fields datatype, maxlength and dropdown reference is specified.


Omitting fields in PUT statements:

Standard behavior: the StudentAdmin database will keep existing value.

The following are mandatory for a PUT / POST request:

The following are optional for a PUT / POST request:

The following New Zealand specific properties - are optional for a PUT / POST request

The following Singapore specific properties - are optional for a PUT / POST request

The following are only returned on a GET request:

Address Section Properties

Address properties (i.e. PermanentAddress, PostalAddress, StreetAddress) are in their turn structures with inner list of properties

The following properties are optional for a PUT / POST request:

There is an AddressLine1 field available which is a concatenation of BoxNumber, BuildingName, StreetName, StreetNumber and UnitDetails. You have the option of:

You will get an error if you try to provide both split address fields and AddressLine1. It is up to you however we encourage to use BoxNumber, BuildingName, StreetName, StreetNumber and UnitDetails as this is what is used in our Apps.

Updating Address Properties

Usually if the field is skipped in the PUT command body it's value will be unmodified, but for Addresses there are special rules applied.

PermanentAddress Section.

If AddressLine1 is not provided BUT one or more of the following are, then the following fields will be overwritten. In this case if one of the following is not provided or provided empty then will be cleared

PostalAddress Section

If AddressLine1 is not provided then the following fields will be overwritten. In this case if one of the following is not provided or provided empty then will be cleared

StreetAddress Section

If AddressLine1 is not provided then the following fields will be overwritten. In this case if one of the following is not provided or provided empty then will be cleared

FeeHelp Section Properties

FeeHelp Section is in it's turn a structure with inner list of properties

The following properties are optional for a PUT / POST request:

Section Example:

	<FeeHelp>
		<HighestEducationLevelYear>1999</HighestEducationLevelYear>
		<TertiaryEntranceScore>123</TertiaryEntranceScore>
		<Year12Postcode>1000</Year12Postcode>
		<Year12Suburb>Mosman</Year12Suburb>
		<YearArrivedInAustralia>1995</YearArrivedInAustralia>
		<YearLeftSchool>1994</YearLeftSchool>
	</FeeHelp>

If you are not sending scalar properties, please do not send empty fields, see below example of sending TertiaryEntranceScore only:

	<FeeHelp>
		<TertiaryEntranceScore>123</TertiaryEntranceScore>
	</FeeHelp>

List All Students

GET /students/

Returns the list of all students.

Max. 1000 students will be returned. If you have more than 1000 students, please use the paging (skip and take parameters)

Sample request:

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

Sample response:

  <StudentSet xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <SetCount>1</SetCount>
    <Students>
      <Student>
        <AtsiStatus>
          <Code>@</Code>
          <Description>Not Stated (Question asked of the client but no answer provided)</Description>
        </AtsiStatus>
        <CountryOfBirth>
          <Description>New Zealand</Description>
        </CountryOfBirth>
        <DateOfBirth>1970-01-01T00:00:00</DateOfBirth>
        <Disabilities>
          <Disability>
            <Description>Other</Description>
          </Disability>
        </Disabilities>
        <EmailAddress>fitzwilliam@darcy.com.au</EmailAddress>
        <EmploymentStatus/>
        <FirstName>Fitzwilliam</FirstName>
        <Gender>
          <Code>M</Code>
          <Description>Male</Description>
        </Gender>
        <HasDisability>Yes</HasDisability>
        <HasPriorEducationalAchievement>Yes - a prior educational achievement has been successfully completed</HasPriorEducationalAchievement>
        <HighestSchoolLevelCompleted>
          <Code>12</Code>
          <Description>Completed Year 12</Description>
        </HighestSchoolLevelCompleted>
        <HighestSchoolLevelCompletedYear>2000</HighestSchoolLevelCompletedYear>
        <IsStillAtSchool>@</IsStillAtSchool>
        <LanguageSpokenAtHome>
          <Code>8998</Code>
          <Description>Aboriginal English, so described (8998)</Description>
        </LanguageSpokenAtHome>
        <LastName>Darcy</LastName>
        <LastUpdated>2012-01-25T10:52:46.65</LastUpdated>
        <Link>
          <Href>students/student/1</Href>
          <Rel>self</Rel>
          <Title>STD0000001: Fitzwilliam Darcy</Title>
        </Link>
        <Mobile>0411111111</Mobile>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
        <PostalAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Code>1101</Code>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </PostalAddress>
        <PriorEducationalAchievements>
          <PriorEducationalAchievement>
            <Description>Certificate IV</Description>
          </PriorEducationalAchievement>
        </PriorEducationalAchievements>
        <RefExternalPlus>customid01</RefExternalPlus>
        <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
        <SpokenEnglishProficiency>
          <Code>2</Code>
          <Description>Well</Description>
        </SpokenEnglishProficiency>
        <StreetAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Code>1101</Code>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </StreetAddress>
        <StudentId>1</StudentId>
        <SyncToSugar>false</SyncToSugar>
        <SyncToXero>false</SyncToXero>
        <TelephoneHome>0211111111</TelephoneHome>
        <TelephoneWork>0211111112</TelephoneWork>
        <Title>Mr</Title>
        <Username>fitzwilliam@darcy.com.au</Username>
      </Student>
    </Students>
  </StudentSet>

C# Code Sample

public static void GetSample()
{
    const string url = "https://tst-api.wisenet.co/students/";
 
    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 Students

GET /students/

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

Returns the list of students created or modified since the specified date.

The Students endpoint will filter on the <LastUpdated> field on each student. This field is updated to the current UTC date whenever a student is created or edited.

Sample request:

 curl -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/

Response format would be the same as for the List All students command.

Note: We would recommend that all calls to list students from the API use this If-Modified-Since header.

C# Code Sample

private static void GetIfModifiedSinceSample()
{
    const string url = "https://tst-api.wisenet.co/students/";
 
    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 wex)
    {
        Console.WriteLine("Error: {0}", wex.Message);
    }
}

Filtered search

List Students by page

GET /students/?skip={skip}&take={take}

Skips {skip} items in student list, then returns {take} items.

Sample request:

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

Response format would be the same as for the List All students command.

List Students with email address

GET /students/?emailaddress={emailaddress}

Returns only those students whose email address is {emailaddress}.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?emailaddress=dick@smith.com

Response format would be the same as for the List All Students command.

List Students with username

GET /students/?username={username}

Returns only those students whose username is {username}.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?username=dick@smith.com

Response format would be the same as for the List All Students command.

Check Student's username and password for Authentication

GET /students/?username={username}

with the header

"X-Wis-Student-Password" = "base64 encoded student password"

Returns only those students whose username is {username} and specified password.

So if GET returns more than 0 students than username&password pair is correct.


'123' base64 encoded is 'MTIz'

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   -H "X-Wis-Student-Password: MTIz" \
   https://tst-api.wisenet.co/students/?username=dick@smith.com

Response format would be the same as for the List All Students command.

If student dick@smith.com has a password '123', than that student will be in the output list.

List Students with specific RefExternalPlus

GET /students/?refexternalplus={refexternalplus}

Returns only those students whose RefExternalPlus is {refexternalplus}.

RefExternalPlus field is used to store identifiers from external systems.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?refexternalplus=ag007

Response format would be the same as for the List All Students command.

List Students with MyWisenet portal access enabled

GET /students/?mywnisactive=true

or

GET /students/?mywnisactive=false

Returns only those students whose access is enabled (true) or disabled (false).

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?mywnisactive=true

Response format would be the same as for the List All Students command.

List Students with e-learning access enabled

GET /students/?moodleaccessenabled=true

or

GET /students/?moodleaccessenabled=false

Returns only those students whose access is enabled (true) or disabled (false).

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?moodleaccessenabled=true

Response format would be the same as for the List All Students command.

List Students with specified Date of Birth

GET /students/?DOB="1989-06-01"

Returns only those students whose Date of Birth is specified.

The format of the date is: YYYY-MM-DD.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?"1989-06-01"

Response format would be the same as for the List All Students command.

List Students whose details contain a search parameter

Fields to search:

GET /students/?PartSearch=Darcy

Returns only those students whose fields see above contain specified parameter.

Sample request:

 curl -X GET \
   -H "Accept: application/vnd.mywisenet.api.v1+xml" \
   https://tst-api.wisenet.co/students/?PartSearch="Darcy"

Response format would be the same as for the List All Students command.

Read Student

GET /students/student/{id}

Returns extended information about 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/1

Sample response 1:

    <Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <AtsiStatus>
          <Code>@</Code>
          <Description>Not Stated (Question asked of the client but no answer provided)</Description>
        </AtsiStatus>
        <CountryOfBirth>
          <Description>New Zealand</Description>
        </CountryOfBirth>
        <DateOfBirth>1970-01-01T00:00:00</DateOfBirth>
        <Disabilities>
          <Disability>
            <Description>Other</Description>
          </Disability>
        </Disabilities>
        <EmailAddress>fitzwilliam@darcy.com.au</EmailAddress>
        <EmploymentStatus/>
        <FirstName>Fitzwilliam</FirstName>
        <Gender>
          <Code>M</Code>
          <Description>Male</Description>
        </Gender>
        <HasDisability>Yes</HasDisability>
        <HasPriorEducationalAchievement>Yes - a prior educational achievement has been successfully completed</HasPriorEducationalAchievement>
        <HighestSchoolLevelCompleted>
          <Code>12</Code>
          <Description>Completed Year 12</Description>
        </HighestSchoolLevelCompleted>
        <HighestSchoolLevelCompletedYear>2000</HighestSchoolLevelCompletedYear>
        <IsStillAtSchool>@</IsStillAtSchool>
        <LanguageSpokenAtHome>
          <Code>8998</Code>
          <Description>Aboriginal English, so described (8998)</Description>
        </LanguageSpokenAtHome>
        <LastName>Darcy</LastName>
        <LastUpdated>2012-01-25T10:52:46.65</LastUpdated>
        <Link>
          <Href>students/student/1</Href>
          <Rel>self</Rel>
          <Title>STD0000001: Fitzwilliam Darcy</Title>
        </Link>
        <Mobile>0411111111</Mobile>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
        <PostalAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Code>1101</Code>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </PostalAddress>
        <PriorEducationalAchievements>
          <PriorEducationalAchievement>
            <Description>Certificate IV</Description>
          </PriorEducationalAchievement>
        </PriorEducationalAchievements>
        <RefExternalPlus>customid01</RefExternalPlus>
        <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
        <SpokenEnglishProficiency>
          <Code>2</Code>
          <Description>Well</Description>
        </SpokenEnglishProficiency>
        <StreetAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Code>1101</Code>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </StreetAddress>
        <StudentId>1</StudentId>
        <SyncToSugar>false</SyncToSugar>
        <SyncToXero>false</SyncToXero>
        <TelephoneHome>0211111111</TelephoneHome>
        <TelephoneWork>0211111112</TelephoneWork>
        <Title>Mr</Title>
        <Username>fitzwilliam@darcy.com.au</Username>
    </Student>

Sample Response 2: incorrect ID would return 404 HTTP code

    <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
        The Student with ID '2' cannot be found.
    </string>

C# Code Sample

private static void ReadSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/36522";
 
    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);
    }
}

Update Student

PUT /students/student/{id}

Updates the student record with the specified {id}.

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

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

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

PUT /students/student/{id}?reload=true


Sample request:

 curl -X PUT \
   -H "Content-Type: application/xml" \
   -v \
   -d @Student1.xml \
   https://tst-api.wisenet.co/students/student/1

Student1.xml:

    <Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <AtsiStatus>
          <Code>@</Code>
          <Description>Not Stated (Question asked of the client but no answer provided)</Description>
        </AtsiStatus>
        <CountryOfBirth>
          <Description>New Zealand</Description>
        </CountryOfBirth>
        <DateOfBirth>1975-01-01T00:00:00</DateOfBirth>
        <Disabilities>
          <Disability>
            <Description>Other</Description>
          </Disability>
        </Disabilities>
        <EmailAddress>fitzwilliam@darcy.com.au</EmailAddress>
        <EmploymentStatus/>
        <FirstName>Fitzwilliam</FirstName>
        <Gender>
          <Code>M</Code>
          <Description>Male</Description>
        </Gender>
        <HasDisability>Yes</HasDisability>
        <HasPriorEducationalAchievement>Yes - a prior educational achievement has been successfully completed</HasPriorEducationalAchievement>
        <HighestSchoolLevelCompleted>
          <Code>12</Code>
          <Description>Completed Year 12</Description>
        </HighestSchoolLevelCompleted>
        <HighestSchoolLevelCompletedYear>2000</HighestSchoolLevelCompletedYear>
        <IsStillAtSchool>@</IsStillAtSchool>
        <LanguageSpokenAtHome>
          <Description>Aboriginal English, so described</Description>
        </LanguageSpokenAtHome>
        <LastName>Darcy</LastName>
        <Mobile>0411111111</Mobile>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
        <PostalAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </PostalAddress>
        <PriorEducationalAchievements>
          <PriorEducationalAchievement>
            <Description>Certificate IV</Description>
          </PriorEducationalAchievement>
        </PriorEducationalAchievements>
        <RefExternalPlus>customid01</RefExternalPlus>
        <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
        <SpokenEnglishProficiency>
          <Code>2</Code>
          <Description>Well</Description>
        </SpokenEnglishProficiency>
        <StreetAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </StreetAddress>
        <SyncToSugar>false</SyncToSugar>
        <SyncToXero>false</SyncToXero>
        <TelephoneHome>0211111111</TelephoneHome>
        <TelephoneWork>0211111112</TelephoneWork>
        <Title>Mr</Title>
        <Username>fitzwilliam@darcy.com.au</Username>
    </Student>

Sample response:

< HTTP/1.1 200 OK
< Date: Mon, 04 Jul 2011 23:34:04 GMT
< Content-Length: 0

C# Code Sample

private static void UpdateSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/1";
 
    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.ContentType = "application/vnd.mywisenet.api.v1+xml";
    request.Method = "PUT";
    request.UserAgent = "C# Sample ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    byte[] byteData = File.ReadAllBytes("Student1.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(responseBody);
            }
        }
    }
    catch (WebException wex)
    {
        Console.WriteLine("Error: {0}", wex.Message);
    }
}

PHP Code Sample

 function updateStudent_curl(){
 
    $credentials = "username:password"; 
    $URL = "https://tst-api.wisenet.co/students/student/426"; //you can add ?reload=true if you wish to get updated student info
 
    $studentUpdateById_XML = '<Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AtsiStatus/><Citizenship/><ClientRequestsPrivacy>false</ClientRequestsPrivacy><CountryOfBirth/><Disabilities/>
<DisabilityAccessed/><DisabilityFlag/><EmailAddress>abbot@mywisenet1.com.au</EmailAddress><EmploymentStatus/><Ethnicity1/>
<Ethnicity2/><Ethnicity3/><FirstName>Adrian</FirstName><Gender><Code>M</Code><Description>Male</Description></Gender>
<HighestSchoolLevelCompleted/><IsActive>true</IsActive><IwiAffiliation1/><IwiAffiliation2/><IwiAffiliation3/>
<LanguageSpokenAtHome/><LastName>Abbot</LastName><LastSchoolAttended/><LastUpdated>2013-04-29T12:18:43.547</LastUpdated><Link>
<Href>students/student/426</Href><Rel>self</Rel><Title>TST01000B7: Adrian Abbot</Title></Link><MaidenName>l</MaidenName>
<MainActivityPriorToStudy/><MoodleAccessEnabled>false</MoodleAccessEnabled><MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
<PermanentAddress><Country/><State><Description/></State></PermanentAddress><PostalAddress>
<AddressLine1>10 Thompson street</AddressLine1><AddressLine3>Drummoyne</AddressLine3><Country>
<Code>1100</Code><Description>Australia (includes External Territories)</Description></Country><PostCode>2047</PostCode><State><Code>01</Code><Description>NSW</Description></State>
</PostalAddress><PriorEducationFlag/><PriorEducationalAchievements/><RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>TST01000B7</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal><ResidentialStatus/>
<SecondaryQualification/><SpokenEnglishProficiency/><StreetAddress><AddressLine1>10 Thompson street</AddressLine1>
<AddressLine3>Drummoyne</AddressLine3><Country><Code>1100</Code><Description>Australia (includes External Territories)</Description>
</Country><PostCode>2047</PostCode><State><Code>01</Code><Description>NSW</Description></State></StreetAddress>
<StudentId>426</StudentId><SyncToSugar>true</SyncToSugar><SyncToXero>true</SyncToXero>
<TelephoneWork>0423232323</TelephoneWork></Student>';
 
    /**
    * Create XML for updating the student information given in XML
    */
 
    /** use a max of 256KB of RAM before going to disk */  
    $putData = fopen('php://temp/maxmemory:256000', 'w+');  
    if (!$putData) {  
        die('could not open temp memory data');  
    }  
    fwrite($putData, $studentUpdateById_XML);  
    fseek($putData, 0);  
 
 
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_PUT, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/vnd.mywisenet.api.v1+xml', 'User-Agent: PHP Sample client') );
    curl_setopt($ch, CURLOPT_INFILE, $putData);  
    curl_setopt($ch, CURLOPT_INFILESIZE, strlen($studentUpdateById_XML)); 
 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERPWD, $credentials);
 
    $result = curl_exec($ch);
    $info = curl_getinfo($ch);
    fclose($putData);
    curl_close($ch);
    if($info['http_code']==204){
        return true;
    }else if($info['http_code']==200){
        return $result;
    }else{
        return false;
    }
 
}

Another PHP Code Sample

 function updateStudent_curl(){
 
    $credentials = "username:password"; 
    $URL = "https://tst-api.wisenet.co/students/student/426";//?reload=true
 
    $studentUpdateById_XML = '<Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AtsiStatus/><Citizenship/><ClientRequestsPrivacy>false</ClientRequestsPrivacy><CountryOfBirth/><Disabilities/>
<DisabilityAccessed/><DisabilityFlag/><EmailAddress>roman@mywisenet.com.au</EmailAddress><EmploymentStatus/><Ethnicity1/>
<Ethnicity2/><Ethnicity3/><FirstName>Adrian</FirstName><Gender><Code>M</Code><Description>Male</Description></Gender>
<HighestSchoolLevelCompleted/><IsActive>true</IsActive><IwiAffiliation1/><IwiAffiliation2/><IwiAffiliation3/>
<LanguageSpokenAtHome/><LastName>Abbot</LastName><LastSchoolAttended/><LastUpdated>2013-04-29T12:18:43.547</LastUpdated><Link>
<Href>students/student/426</Href><Rel>self</Rel><Title>TST01000B7: Adrian Abbot</Title></Link><MaidenName>l</MaidenName>
<MainActivityPriorToStudy/><MoodleAccessEnabled>false</MoodleAccessEnabled><MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
<PermanentAddress><Country/><State><Description/></State></PermanentAddress><PostalAddress>
<AddressLine1>10 Thompson street</AddressLine1><AddressLine3>Drummoyne</AddressLine3><Country><Code>1100</Code>
<Description>Australia (includes External Territories)</Description></Country><PostCode>2047</PostCode><State><Code>01</Code>
<Description>NSW</Description></State></PostalAddress><PriorEducationFlag/><PriorEducationalAchievements/>
<RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>TST01000B7</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal><ResidentialStatus/><SecondaryQualification/><SpokenEnglishProficiency/><StreetAddress>
<AddressLine1>10 Thompson street</AddressLine1><AddressLine3>Drummoyne</AddressLine3><Country><Code>1100</Code>
<Description>Australia (includes External Territories)</Description></Country><PostCode>2047</PostCode><State><Code>01</Code>
<Description>NSW</Description></State></StreetAddress><StudentId>426</StudentId><SyncToSugar>true</SyncToSugar>
<SyncToXero>true</SyncToXero><TelephoneWork>04320432</TelephoneWork></Student>';
 
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/vnd.mywisenet.api.v1+xml', 'User-Agent: PHP Sample client' ,'Content-Length: ' . strlen($studentUpdateById_XML)));
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); 
    curl_setopt($ch, CURLOPT_POSTFIELDS,$studentUpdateById_XML);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERPWD, $credentials);
 
    $result = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    if($info['http_code']==204){
        return true;
    }else if($info['http_code']==200){
        return $result;
    }else{
        return false;
    }
 
}

Add Student

POST /students/

Inserts a new student record.

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

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

Restriction: StudentId must be empty.

The Location header on the HTTP response will indicate the URI of the newly created Student resource.

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

POST /students/?reload=true

Sample request:

curl -X POST \
  -H "Content-Type: application/xml" \
  -d @NewStudent.xml \
  -v \
  https://tst-api.wisenet.co/students/

NewStudent.xml:

        <Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <AtsiStatus>
          <Code>@</Code>
          <Description>Not Stated (Question asked of the client but no answer provided)</Description>
        </AtsiStatus>
        <CountryOfBirth>
          <Description>New Zealand</Description>
        </CountryOfBirth>
        <DateOfBirth>1970-01-01T00:00:00</DateOfBirth>
        <Disabilities>
          <Disability>
            <Description>Other</Description>
          </Disability>
        </Disabilities>
        <EmailAddress>fitzwilliam@darcy.com.au</EmailAddress>
        <EmploymentStatus/>
        <FirstName>Fitzwilliam</FirstName>
        <Gender>
          <Code>M</Code>
          <Description>Male</Description>
        </Gender>
        <HasDisability>Yes</HasDisability>
        <HasPriorEducationalAchievement>Yes - a prior educational achievement has been successfully completed</HasPriorEducationalAchievement>
        <HighestSchoolLevelCompleted>
          <Code>12</Code>
          <Description>Completed Year 12</Description>
        </HighestSchoolLevelCompleted>
        <HighestSchoolLevelCompletedYear>2000</HighestSchoolLevelCompletedYear>
        <IsStillAtSchool>@</IsStillAtSchool>
        <LanguageSpokenAtHome>
          <Description>Aboriginal English, so described</Description>
        </LanguageSpokenAtHome>
        <LastName>Darcy</LastName>
        <Mobile>0411111111</Mobile>
        <MoodleAccessEnabled>true</MoodleAccessEnabled>
        <MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled>
        <PostalAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </PostalAddress>
        <PriorEducationalAchievements>
          <PriorEducationalAchievement>
            <Description>Certificate IV</Description>
          </PriorEducationalAchievement>
        </PriorEducationalAchievements>
        <RefExternalPlus>customid01</RefExternalPlus>
        <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
        <SpokenEnglishProficiency>
          <Code>2</Code>
          <Description>Well</Description>
        </SpokenEnglishProficiency>
        <StreetAddress>
          <AddressLine1>1 Darcy Street</AddressLine1>
          <AddressLine3>Parramatta</AddressLine3>
          <Country>
            <Description>Australia</Description>
          </Country>
          <PostCode>2150</PostCode>
          <State>
            <Code>01</Code>
            <Description>NSW</Description>
          </State>
        </StreetAddress>
        <SyncToSugar>false</SyncToSugar>
        <SyncToXero>false</SyncToXero>
        <TelephoneHome>0211111111</TelephoneHome>
        <TelephoneWork>0211111112</TelephoneWork>
        <Title>Mr</Title>
        <Username>fitzwilliam@darcy.com.au</Username>
    </Student>

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/students/student/2

C# Code Sample

private static void AddSample()
{
    const string url = "https://tst-api.wisenet.co/students/";
 
    var request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.ContentType = "application/xml";
    request.Method = "POST";
    request.UserAgent = "C# Sample ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    byte[] byteData = File.ReadAllBytes("NewStudent.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);
    }
}

Sample request to post a JSON:

curl -X POST \
  -H "Content-Type: application/json" \
  -d @NewStudent.json \
  -v \
  https://tst-api.wisenet.co/students/

NewStudent.json:

{"FirstName" : "Juliette",
 "Gender": { "Code": "F", "Description": "Female" },
 "LastName" : "Silverton"
}

PHP Code Sample

function createStudent_curl(){
 
    $credentials = "username:password"; 
    $URL = "https://tst-api.wisenet.co/students/";
 
    $student_XML = '<Student xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><AtsiStatus><Code>@</Code><Description>Not Stated (Question asked of the client but no answer provided)</Description>
</AtsiStatus><CountryOfBirth><Description>New Zealand</Description></CountryOfBirth><DateOfBirth>1970-01-01T00:00:00</DateOfBirth><Disabilities><Disability><Description>Other</Description></Disability>
</Disabilities><EmailAddress>fitzwilliam@darcy.com.au</EmailAddress><EmploymentStatus/><FirstName>Fitzwilliam</FirstName><Gender><Code>M</Code><Description>Male</Description></Gender>
<HasPriorEducationalAchievement>Yes - a prior educational achievement has been successfully completed</HasPriorEducationalAchievement><HighestSchoolLevelCompleted><Code>12</Code><Description>Completed Year 12</Description>
</HighestSchoolLevelCompleted><HighestSchoolLevelCompletedYear>2000</HighestSchoolLevelCompletedYear><IsStillAtSchool>@</IsStillAtSchool><LanguageSpokenAtHome><Code>8998</Code>
<Description>Aboriginal English, so described (8998)</Description></LanguageSpokenAtHome><LastName>Darcy</LastName><Mobile>0411111111</Mobile><MoodleAccessEnabled>true</MoodleAccessEnabled>
<MyWiseNetAccountEnabled>false</MyWiseNetAccountEnabled><PostalAddress><AddressLine1>1 Darcy Street</AddressLine1><AddressLine3>Parramatta</AddressLine3><Country><Code>1101</Code><Description>Australia</Description>
</Country><PostCode>2150</PostCode><State><Code>01</Code><Description>NSW</Description></State></PostalAddress><PriorEducationalAchievements><PriorEducationalAchievement><Description>Certificate IV</Description>
</PriorEducationalAchievement></PriorEducationalAchievements><RefExternalPlus>customid01</RefExternalPlus><RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal><SpokenEnglishProficiency><Code>2</Code><Description>Well</Description>
</SpokenEnglishProficiency><StreetAddress><AddressLine1>1 Darcy Street</AddressLine1><AddressLine3>Parramatta</AddressLine3><Country><Code>1101</Code><Description>Australia</Description></Country><PostCode>2150</PostCode>
<State><Code>01</Code><Description>NSW</Description></State></StreetAddress><SyncToSugar>false</SyncToSugar><SyncToXero>false</SyncToXero><TelephoneHome>0211111111</TelephoneHome>
<TelephoneWork>0211111112</TelephoneWork><Title>Mr</Title><Username>fitzwilliam@darcy.com.au</Username></Student>';
 
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/xml', 'User-Agent: PHP Sample client' ,'Content-Length: ' . strlen($student_XML)));
 
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 
    curl_setopt($ch, CURLOPT_POSTFIELDS,$student_XML);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERPWD, $credentials);
 
    $result = curl_exec($ch);
    $info = curl_getinfo($ch);
    print_r($info);
    curl_close($ch);
    if($info['http_code']==204){
        return true;
    }else if($info['http_code']==200){
        return $result;
    }else{
        return false;
    }
 
}

Minimum JSON to POST a Student

{   "FirstName": "Harry",
    "Gender": {
        "Code": "M",
        "Description": "Male"
        },
    "LastName": "Potter",
}
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