JavaScript examples
Last updated
Last updated
These examples use the SureSheet.
(async () => {
const workbookId = "abc7cbef-2491-4787-94f8-6542fab12a4e";
const simulateUrl = `https://www.equalto.com/suresheet/api/v1/simulate/${workbookId}`;
const response = await fetch(simulateUrl, {
method: 'POST',
body: JSON.stringify({
inputs: {
Sheet1: {
C6: 25000,
},
},
outputs: {
Sheet1: ['C13'],
},
}),
headers: {
'Content-Type': 'application/json',
},
});
const responseJson = await response.json();
console.log(responseJson)
})();
Should print:
{'Sheet1': {'C13': 50783.31719489607}}
(async () => {
const workbookId = "abc7cbef-2491-4787-94f8-6542fab12a4e";
const simulateUrl = `https://www.equalto.com/suresheet/api/v1/simulate/${workbookId}`;
const response = await fetch(simulateUrl, {
method: 'POST',
body: JSON.stringify({
inputs: {
Sheet1: {
C6: 25000,
},
},
outputs: {
Sheet1: ['C13', 'B14:C16'],
},
}),
headers: {
'Content-Type': 'application/json',
},
});
const responseJson = await response.json();
console.log(responseJson)
})();
Should print:
{
"Sheet1": {
"C13": 50783.31719489607,
"B14:C16": [
[
" Initial investment amount:",
25000.0
],
[
" Additional contributions:",
10500.0
],
[
" Interest earned:",
15283.31719489607
]
]
}
}