WiseNET.API - Student's Next of Kin Endpoint

From Wisenet Resource Centre
Jump to: navigation, search


The Wise.NET Next of Kin endpoint allows your applications to get information about the next of kin for a student.

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

Contents

Related Endpoints

Next of Kin Properties

The following are mandatory for a PUT / POST request:

The following are optional for a PUT / POST request:

The following are only returned on a GET request:

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>
  <RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>STD0000001</RefInternalUnique student identifier automatically produced by Wise.NET. Compare RefExternal>
  <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 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 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 ClientIn Wise.NET a client is a student, trainee or apprentice";
 
    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);
    }
}
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