Skip to main content
Skip table of contents

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 documenation is provided for partners who are still using this version.

OnLoadLegacySampleCase() function - Load a Sample Legacy Case

This is used only for testing. It loads 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.

JS
function OnLoadLegacySampleCase() {
    $("#resultjson").show().html(JSON.stringify(legacyCase, null, 2));
    $("#apiresult").html("Sample legacy case loaded.");
}

OnPushLegacyCase() function - Push new or existing Legacy Case

This sample code pushes a sample case in legacy JSON format.

JS
function OnPushLegacyCase() {
    var url = '/service/pushlegacycase';
    var data = JSON.parse($("#resultjson").html());
    OnGetJson(url, data);
}

OnGetLegacyCase() function - Get Existing Legacy Case

This sample code will retrieve the current case as set by a previous call to SetCase(), in legacy JSON format.

JS
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 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 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:

CODE
{

        "id": 7,

        "name": "Ravi weekly business income ",

        "ownerId": 1,

        "type": "Business",

        "amount": {

          "value": 2000,

          "frequency": "Week"

        }

      }
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.