The Wisenet 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
- 1 Related Endpoints
- 2 Student Properties
- 3 List All Students
- 4 List modified Students
- 5 Filtered search
- 5.1 List Students by page
- 5.2 List Students with email address
- 5.3 List Students with username
- 5.4 Check Student’s username and password for Authentication
- 5.5 List Students with specific RefExternalPlus
- 5.6 List Students with MyWisenet portal access enabled
- 5.7 List Students with e-learning access enabled
- 5.8 List Students with specified Date of Birth
- 5.9 List Students whose details contain a search parameter
- 6 Read Student
- 7 Update Student
- 8 Add Student
- 9 Minimum JSON to POST a Student
- 10 Related Articles
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:
- FirstName (maxlength:50)
- Gender (see dropdowns: Gender)
- LastName (maxlength:50)
The following are optional for a PUT / POST request:
- AlternativeEmailAddress (maxlength:80)
- AtsiStatus (see dropdowns: ATSIStatus)
- CHESSN (maxlength:10)
- ClientRequestsPrivacy (bit)
- Comment (maxlength:3000)
- CountryOfBirth (see dropdowns: Country. Recommended to only pass description NOT code)
- DateOfBirth (date)
- Disabilities (see dropdowns: Disabilities)
- EmailAddress (maxlength:80)
- EmploymentStatus (see dropdowns: EmploymentStatus)
- FaxHome (maxlength:15)
- FaxWork (maxlength:15)
- FeeHelp (see below: FeeHelp Section Properties)
- HasDisability (“Yes”, “No”, or “Not Stated”)
- HasPriorEducationalAchievement (string value, must be one of Descriptions from dropdown: HasPriorEducationalAchievement)
- HighestSchoolLevelCompleted (see dropdowns: HighestSchoolLevelCompleted)
- HighestSchoolLevelCompletedYear (maxlength:4)
- IndustryType (see dropdowns: IndustryType)
- InformalName (maxlength:20)
- InternationalEnglishTestScore (int)
- IsActive (bit)
- IsStillAtSchool (Specify only “Y” or “N” or “@”)
- IsUSIVerified — NOTE: Sorry this is obsolete. USI Status is not currently available in the API 🙁
- LanguageSpokenAtHome (see dropdowns: Language. Recommended to only pass description NOT code)
- LearnerUniqueIdentifier (maxlength:20)
- MaidenName (maxlength:50)
- MiddleName (maxlength:50)
- Mobile (maxlength:20)
- MoodleAccessEnabled (bit)
- MyWiseNetAccountEnabled (bit)
- MyWiseNetExpiryDate (date)
- Nationality (see dropdowns: Country. Recommended to only pass description NOT code)
- OccupationType (see dropdowns: OccupationType)
- PassportCountry (see dropdowns: Country. Recommended to only pass description NOT code)
- PassportExpiryDate (date)
- PassportNumber (maxlength:20)
- PermanentAddress (see below: Address Section Properties)
- PostalAddress (see below: Address Section Properties)
- PriorEducationalAchievements
- Description (see dropdowns: PriorEducationalAchievements)
- PriorEducationType (see dropdowns: PriorEducationType)
- RefExternal (maxlength:10)
- RefExternalPlus (maxlength:50)
- SACEID (maxlength:20)
- SpecialRequirements (maxlength:1000)
- SpokenEnglishProficiency (see dropdowns: SpokenEnglishProficiency)
- StreetAddress (see below: Address Section Properties)
- StudentPassword (Write-only) (maxlength:200)
- Suffix (maxlength:50)
- SyncToSugar (bit)
- SyncToXero (bit)
- TargetGroup (custom dropdown: see values defined in app)
- TaxFileNumber (maxlength:11)
- TelephoneHome (maxlength:15)
- TelephoneWork (maxlength:15)
- Title (maxlength:20)
- USI (maxlength:10) (NOTE: this needs to be before Username even though not alpha order)
- Username (maxlength:150)
- VictorianStudentNumber (maxlength:9)
The following New Zealand specific properties – are optional for a PUT / POST request
- AustralianResidentialStatus (Specify only “Y” or “N”)
- CitizenshipCountry (see dropdowns: Country. Recommended to only pass description NOT code)
- DisabilityAccessed (see dropdowns: DisabilityAccessed)
- DisabilityFlag (see dropdowns: DisabilityFlag)
- Ethnicity1 (see dropdowns: Ethnicity)
- Ethnicity2 (see dropdowns: Ethnicity)
- Ethnicity3 (see dropdowns: Ethnicity)
- FirstYearOfFormalEducation (maxlength:4)
- IrdNumber (maxlength:10)
- IwiAffiliation1 (see dropdowns: IWI)
- IwiAffiliation2 (see dropdowns: IWI)
- IwiAffiliation3 (see dropdowns: IWI)
- LastSchoolAttended (see dropdowns: LastSchoolAttended)
- LastYearAtSecondarySchool (int maxlength:4)
- MainActivityPriorToStudy (see dropdowns: IWI)
- NationalStudentNumber (maxlength:10)
- ResidentialStatus (see dropdowns: ResidentialStatus (NZ))
- SecondaryQualification (see dropdowns: SecondaryQualification)
The following Singapore specific properties – are optional for a PUT / POST request
- NRICFIN (maxlength:20)
- NRICType (see dropdowns: NRICType (SG))
- ResidentialStatus (see dropdowns: ResidentialStatus (SG))
- SGExtraNationality (see dropdowns: SGExtraNationality)
- SingaporeIdNumber (maxlength:20)
The following are only returned on a GET request:
- LastUpdated
- Link
- RefInternal
- StudentId
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:
- AddressLine2 (maxlength:50)
- AddressLine3 (maxlength:50)
- BoxNumber (maxlength:22) (only for PermanentAddress and PostalAddress)
- BuildingName (maxlength:50)
- Country (c) (see dropdowns: Country or NZCountry. Recommended to only pass description NOT code)
- PostCode (maxlength:20)
- Region (used for NoK only)
- State (see dropdowns: State)
- StreetName (maxlength:70)
- StreetNumber (maxlength:15)
- UnitDetails (maxlength:30)
There is an AddressLine1 field available which is a concatenation of BoxNumber, BuildingName, StreetName, StreetNumber and UnitDetails. You have the option of:
- providing BoxNumber, BuildingName, StreetName, StreetNumber and UnitDetails
- or ONLY AddressLine1 (this will set the StreetName and AddressLine1 to have the same value)
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
- StreetName;
- BoxNumber;
- BuildingName;
- StreetNumber;
- UnitDetails;
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
- StreetName;
- BoxNumber;
- BuildingName;
- StreetNumber;
- UnitDetails;
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
- StreetName;
- BuildingName;
- StreetNumber;
- UnitDetails;
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:
- CitizenResident (see dropdowns: CitizenResident (FH))
- HighestEducationLevel (see dropdowns: HighestEducationLevel (FH))
- HighestEducationLevelYear (maxlength:4)
- IndigenousStatus (see dropdowns: IndigenousStatus (FH))
- ParentEducationLevel1 (see dropdowns: ParentEducationLevel (FH))
- ParentEducationLevel2 (see dropdowns: ParentEducationLevel (FH))
- TertiaryEntranceScore (int maxlength:3)
- Year12Postcode (maxlength:20)
- Year12Suburb (maxlength:50)
- YearArrivedInAustralia (maxlength:4)
- YearLeftSchool (maxlength:4)
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> <RefInternal>STD0000001</RefInternal> <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 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 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 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 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:
- FirstName
- InformalName
- LastName
- Mobile
- NationalStudentNumber
- RefExternal
- RefExternalPlus
- RefInternal
- RefInternalInt
- SingaporeIdNumber
- USI
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> <RefInternal>STD0000001</RefInternal> <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 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); } }
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> <RefInternal>STD0000001</RefInternal> <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 Client"; 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/><RefInternal>TST01000B7</RefInternal><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/> <RefInternal>TST01000B7</RefInternal><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> <RefInternal>STD0000001</RefInternal> <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 Client"; 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><RefInternal>STD0000001</RefInternal><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", }