Loading...

OLD API Endpoint: Student’s Next of Kin

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 Wisenet Next of Kin Endpoint allows your applications to get information about the next of kin for a student.

Related Endpoints

Next of Kin Properties

The following are mandatory for a PUT / POST request:

  • InternationalNextOfKin
    • Address
  • LocalNextOfKin
    • Address
  • StudentId

The following are optional for a PUT / POST request:

  • InternationalNextOfKin
    • Email (maxlength:100)
    • FirstName (maxlength:20)
    • HomePhone (maxlength:20)
    • LastName (maxlength:50)
    • MiddleName (maxlength:20)
    • Mobile (maxlength:20)
    • WorkPhone (maxlength:20)
  • LocalNextOfKin
    • Email (maxlength:100)
    • FirstName (maxlength:20)
    • HomePhone (maxlength:20)
    • LastName (maxlength:40)
    • MiddleName (maxlength:20)
    • Mobile (maxlength:20)
    • Nationality (see dropdowns: Country)
    • Occupation (maxlength:100)
    • PassportCountry (see dropdowns: Country)
    • PassportNumber (maxlength:20)
    • Relationship (custom dropdown: available in References)
    • WorkPhone (maxlength:20)

The following are only returned on a GET request:

  • Link
  • RefInternal
  • StudentFirstName
  • StudentLastName
  • StudentLink

Read Next of Kin for Student

GET /students/student/{id}/nextofkin

Returns the next of kin for the student with the given {id}

Sample request:

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

Sample response:

<NextOfKin xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <InternationalNextOfKin>
    <Address>
      <AddressLine1>Pemberley</AddressLine1>
      <AddressLine2>1 Darcy Street</AddressLine2>
      <AddressLine3>Lambton</AddressLine3>
      <Country>
        <Code>2100</Code>
        <Description>United Kingdom</Description>
      </Country>
      <PostCode>1080</PostCode>
      <Region>Derbyshire</Region>
    </Address>
    <Email>old.mr@darcy.com.au</Email>
    <FirstName>Old</FirstName>
    <HomePhone>0211111111</HomePhone>
    <LastName>Darcy</LastName>
    <MiddleName>Mister</MiddleName>
    <Mobile>0411111111</Mobile>
    <WorkPhone>0211111112</WorkPhone>
  </InternationalNextOfKin>
  <Link>
    <Href>students/student/1/nextofkin</Href>
    <Rel>self</Rel>
    <Title>STD0000001: Fitzwilliam Darcy - Next Of Kin</Title>
  </Link>
  <LocalNextOfKin>
    <Address>
      <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>
    </Address>
    <Email>lady.anne@darcy.com.au</Email>
    <FirstName>Lady</FirstName>
    <HomePhone>0211111111</HomePhone>
    <LastName>Darcy</LastName>
    <MiddleName>Anne</MiddleName>
    <Mobile>0411111111</Mobile>
    <Nationality>
      <Code>1101</Code>
      <Description>Australia</Description>
    </Nationality>
    <Occupation>Homemaker</Occupation>
    <PassportCountry>
      <Code>1101</Code>
      <Description>Australia</Description>
    </PassportCountry>
    <PassportNumber>AU1234</PassportNumber>
    <Relationship>Mother</Relationship>
  </LocalNextOfKin>
  <RefInternal>STD0000001</RefInternal>
  <StudentFirstName>Fitzwilliam</StudentFirstName>
  <StudentId>1</StudentId>
  <StudentLastName>Darcy</StudentLastName>
  <StudentLink>
    <Href>students/student/1</Href>
    <Rel>student</Rel>
    <Title>STD0000001: Fitzwilliam Darcy</Title>
  </StudentLink>
</NextOfKin>

C# Code Sample

public static void GetCourseEnrolmentsSample()
{
    const string url = "https://tst-api.wisenet.co/students/student/{id}/nextofkin";
 
    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 Next of Kin for a Student

PUT /students/student/{id}/nextofkin

Updates the next of kin for the student record with the specified {id}.

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

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

Sample request:

 curl -X PUT \
   -H "Content-Type: application/vnd.mywisenet.api.v1+xml" \
   -v \
   -d @NextOfKin1.xml \
   https://tst-api.wisenet.co/students/student/1/nextofkin

NextOfKin1.xml:

<NextOfKin xmlns="http://api.mywisenet.com.au/v1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <InternationalNextOfKin>
    <Address>
      <AddressLine1>Pemberley</AddressLine1>
      <AddressLine2>1 Darcy Street</AddressLine2>
      <AddressLine3>Lambton</AddressLine3>
      <Country>
        <Code>2100</Code>
        <Description>United Kingdom</Description>
      </Country>
      <PostCode>1080</PostCode>
      <Region>Derbyshire</Region>
    </Address>
    <Email>old.mr@darcy.com.au</Email>
    <FirstName>Old</FirstName>
    <HomePhone>0211111111</HomePhone>
    <LastName>Darcy</LastName>
    <MiddleName>Mister</MiddleName>
    <Mobile>0411111111</Mobile>
    <WorkPhone>0211111112</WorkPhone>
  </InternationalNextOfKin>
  <LocalNextOfKin>
    <Address>
      <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>
    </Address>
    <Email>lady.anne@darcy.com.au</Email>
    <FirstName>Lady</FirstName>
    <HomePhone>0211111111</HomePhone>
    <LastName>Darcy</LastName>
    <MiddleName>Anne</MiddleName>
    <Mobile>0411111111</Mobile>
    <Nationality>
      <Code>1101</Code>
      <Description>Australia</Description>
    </Nationality>
    <Occupation>Homemaker</Occupation>
    <PassportCountry>
      <Code>1101</Code>
      <Description>Australia</Description>
    </PassportCountry>
    <PassportNumber>AU1234</PassportNumber>
    <Relationship>Mother</Relationship>
  </LocalNextOfKin>
  <StudentId>1</StudentId>
</NextOfKin>

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/nextofkin";
 
    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("NextOfKin1.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 ex)
    {
        Console.WriteLine("Error: {0}", wex.Message);
    }
}

Was this Resource helpful?