With Open as App you don't need to re-implement the complex Excel calculations in your application. Open as App gives you the possibility to use your Excel calculations with a simple REST API.

Creating the App

Go to Open as App Portal and login with your account. Go to the App-Templates and search for "BMI" and click on it. Now you can see the description of this app and with a click on "Create own app based on this template" you get a copy of this App in your Account.

API-Token

Now before we can use the Calculation-API, we need to create a API-Token. Go to /user/apiTokens, give a Token description and click on "Try It" button. After entering your credentials, you will get a response with a token.

As described in the apiTokens, you need this token in your header.

Calculation-API

After you copied your calculation App, we need its id. You can get the id over the portal. Got to the Apps Dashboard and click on the app. On the left navigation click on Design & Info > Name and description. Here you can see the App-id. You can also use the AppAdmin API to get the App id.

After we have the id, we can now use the CalculateResult endpoint in following format:

{
  inputValues: {
    weight: 90,
    height: 180
  }
}

Here we send 90 as weight and 180 as height. We can use here names instead of Cell addresses because they are defined in the XML Configuration. If you want to see the XML Configuration, go to the Apps Dashboard click on the BMI App and in the left navigation click on Advanced > XML Configuration.
In the response we get all output Fields defined for our app in following format:

{
    "outputValues":{
        "bmi":{
            "value":27.777777777777775,
            "string":"27.78"
        },
        "rating":{
            "value":"Übergewicht",
            "string":"Übergewicht"
        },
        "8iqVYmOH":{
            "value":null,
            "string":""
        }
    },
    "attachments":{

    }
}

Print function

Maybe you noticed the attachments Object in the result. In this Object, we get get the URL to a PDF File if we turn on the Print function for our App. To do so, go again to the App Admin page. Click on the left navigation to Edit > Print functionality and select the Sheet to Print. Click Save on the Top navigation. In your own App, you could create extra pages with a printer friendly layout.

Now if you use the CalculateResult endpoint again. We will get a result like this:

{
    "outputValues":{
        "bmi":{
            "value":27.777777777777775,
            "string":"27.78"
        },
        "rating":{
            "value":"Übergewicht",
            "string":"Übergewicht"
        },
        "8iqVYmOH":{
            "value":null,
            "string":""
        }
    },
    "attachments":{
        "Blatt1.pdf":"https://api.openasapp.net/v1/api/apps/64832364-f6fb-4fbb-8fc8-ffeacb5b1190/fields/print?data=eyJJbnB1dFZhbHVlcyI6eyJ3ZWlnaHQiOiI5MCIsImhlaWdodCI6IjE4MCJ9fQ%3D%3D"
    }
}