LiteWeightings API

API change history

Retrieve the VitaCurvesLITE weightings for a given exercise.

Get Lite Weightings

Get Lite Weightings

Try it

Request

Request URL

Request parameters

  • string
  • (optional)
    integer

    Format - int32.

Request headers

  • string
  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

Success

Representations

{
  "correlationId": "External System Id",
  "weightings": [
    {
      "memberId": "ID1",
      "appliedPensionAmount1stLife": 50000.0,
      "appliedPensionAmount2ndLife": 20000.0,
      "mappedCurve1stLife": "CV20v1_1618_FPAapb4",
      "mappedCurve2ndLife": "CV20v1_1618_MWAapb2",
      "age1stLife": 65,
      "age2ndLife": 68,
      "eol1stLife": 23.10772,
      "expectedAgeAtDeath1stLife": 88,
      "expectedAgeAtCommencement2ndLife": 91,
      "eolAtAgeOfCommencement2ndLife": 3.6880107,
      "lxRatio": 0.20379964,
      "liteWeighting1stLife": 1155386.0,
      "liteWeighting2ndLife": 15032.305
    }
  ],
  "links": {
    "self": {
      "href": "string"
    },
    "next": {
      "href": "string"
    },
    "exercise": {
      "href": "string"
    }
  }
}
{
  "type": "object",
  "properties": {
    "correlationId": {
      "type": "string",
      "description": "A unique correlation ID generated. It will be consistent across any batches associated with that data set.",
      "nullable": true,
      "example": "External System Id"
    },
    "weightings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "memberId": {
            "type": "string",
            "description": "A unique ID for each member, generated for the purposes of this interface.",
            "nullable": true,
            "example": "ID1"
          },
          "appliedPensionAmount1stLife": {
            "type": "number",
            "description": "The pension amount or lite curves weighting pension amount if provided, adjusted from the date specified on the input to curves date if revaluation is used.",
            "format": "double",
            "example": 50000.0
          },
          "appliedPensionAmount2ndLife": {
            "type": "number",
            "description": "The contingent (2nd) life pension amount or lite curves weighting pension amount if provided, adjusted from the date specified on the input to curves date if revaluation is used.",
            "format": "double",
            "example": 20000.0
          },
          "mappedCurve1stLife": {
            "type": "string",
            "description": "Identifies the VitaCurve which best represents the base mortality of the member data supplied.",
            "nullable": true,
            "example": "CV20v1_1618_FPAapb4"
          },
          "mappedCurve2ndLife": {
            "type": "string",
            "description": "Identifies the VitaCurve which best represents the base mortality of the contingent (2nd) life associated with the\r\nmember data supplied.",
            "nullable": true,
            "example": "CV20v1_1618_MWAapb2"
          },
          "age1stLife": {
            "type": "integer",
            "description": "The member age as provided.",
            "format": "int32",
            "example": 65
          },
          "age2ndLife": {
            "type": "integer",
            "description": "The contingent (2nd) life member age which is the provided 1st life member age with an adjustment applied.",
            "format": "int32",
            "example": 68
          },
          "eol1stLife": {
            "type": "number",
            "description": "EOL from 1st life member age.",
            "format": "double",
            "example": 23.10772
          },
          "expectedAgeAtDeath1stLife": {
            "type": "integer",
            "description": "1st life expected age at death.",
            "format": "int32",
            "example": 88
          },
          "expectedAgeAtCommencement2ndLife": {
            "type": "integer",
            "description": "Contingent (2nd) life age at expected commencement.",
            "format": "int32",
            "example": 91
          },
          "eolAtAgeOfCommencement2ndLife": {
            "type": "number",
            "description": "Continent (2nd) life EOL from age at expected commencement.",
            "format": "double",
            "example": 3.6880107
          },
          "lxRatio": {
            "type": "number",
            "description": "Probability that contingent (2nd) life survives to 1st life death based on mapped 2nd life curve.",
            "format": "double",
            "example": 0.20379964
          },
          "liteWeighting1stLife": {
            "type": "number",
            "description": "The Lite weighting amount for the 1st life.",
            "format": "double",
            "example": 1155386.0
          },
          "liteWeighting2ndLife": {
            "type": "number",
            "description": "The lite weighting amount for the contingent (2nd) life.",
            "format": "double",
            "example": 15032.305
          }
        },
        "additionalProperties": false
      },
      "nullable": true
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "nullable": true
            }
          },
          "additionalProperties": false
        },
        "next": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "nullable": true
            }
          },
          "additionalProperties": false
        },
        "exercise": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "nullable": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

303 See Other

Redirect

Code samples

@ECHO OFF

curl -v -X GET "https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}?page=1"
-H "Accept: application/hal+json;v=1"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers

            client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/hal+json;v=1"));
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["page"] = "1";
            var uri = "https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}");

            builder.setParameter("page", "1");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Accept", "application/hal+json;v=1");
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
            "page": "1",
        };
      
        $.ajax({
            url: "https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Accept","application/hal+json;v=1");
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"page=1",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"application/hal+json;v=1" forHTTPHeaderField:@"Accept"];
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Accept' => 'application/hal+json;v=1',
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'page' => '1',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Accept': 'application/hal+json;v=1',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'page': '1',
})

try:
    conn = httplib.HTTPSConnection('hymans-api.co.uk')
    conn.request("GET", "/evitacurves/liteweightings/{exerciseId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Accept': 'application/hal+json;v=1',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'page': '1',
})

try:
    conn = http.client.HTTPSConnection('hymans-api.co.uk')
    conn.request("GET", "/evitacurves/liteweightings/{exerciseId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://hymans-api.co.uk/evitacurves/liteweightings/{exerciseId}')

query = URI.encode_www_form({
    # Request parameters
    'page' => '1'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Accept'] = 'application/hal+json;v=1'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body