Legacy Input API
Before using the functions on this page, you may find it useful to review the following information:
The list of all functions is here.
Description of this function | This function has been replaced by the newer Input API function. However, this documentation is provided for partners who are still using this version. |
---|---|
List of functions |
|
OnLoadLegacySampleCase()
function – Load a Sample Legacy Case
This JavaScript function does not directly use the API. It in used in API Test View to load a couple of sample objects in the legacy JSON format into the “#resultjson” <pre>
tag. This can then be used to push a case in the next step.
function OnLoadLegacySampleCase() {
$("#resultjson").show().html(JSON.stringify(legacyCase, null, 2));
$("#apiresult").html("Sample legacy case loaded.");
}
/service/pushLegacyCase
function – Push new or existing Legacy Case
This sample code pushes a sample case in legacy JSON format.
function OnPushLegacyCase() {
var url = '/service/pushlegacycase';
var data = JSON.parse($("#resultjson").html());
OnGetJson(url, data);
}
/service/getLegacyCase
function – Get Existing Legacy Case
This sample code will retrieve the current case as set by a previous call to /service/setCase
, in legacy JSON format.
function OnGetLegacyCase() {
var guid = $('#scenarioguid').val();
OnGetJson('/service/getlegacycase', {
scenarioGuid: guid
});
}
Frequencies
For some fields in the input API, a frequency should be specified. If a frequency is not specified then, in Pathfinder it will default to 'Annual'.
If the JSON file contains a frequency that is not listed in the table below, then in Pathfinder it will appear as 'Invalid' and will be flagged with an error so the user will need to correct it before they can solve the case.
Frequency as it appears in the Pathfinder interface | Acceptable inputs from Optimo legacy input API Note: inputs are case insensitive, so any combination of upper/lower case will work |
---|---|
One Off (this will apply the amount in the first year only) | OneOff One-Off OnceOff |
Weekly | Week, Weekly |
Fortnightly | Fortnight, Fortnightly |
Monthly | Month, Monthly |
Quarterly | Quarter, Quarterly |
Annual | Year, Yearly, annual |
Every 2nd year | Every 2nd year |
Every 3rd year | Every 3rd year |
Every 4th year | Every 4th year |
Every 5th year | Every 5th year |
An example of the JSON with frequency=Week is:
{
"id": 7,
"name": "Ravi weekly business income ",
"ownerId": 1,
"type": "Business",
"amount": {
"value": 2000,
"frequency": "Week"
}
}