Awell Health Developer Hub
Developer Hub

This endpoint allows you to simulate a calculation and therefore helps you understand what inputs a calculation expects and what results it returns. When calling this endpoint, 2 things will happen:

  1. Random calculation inputs (i.e. response) for the calculation are generated
  2. Scores will be calculated based on the generated inputs

Request

Endpoint

GET/v1/calculations/simulate/{calculationId}

Path parameters

This endpoint expects a calculationId to be passed as a path parameter.

ParameterTypeRequired
calculationIdstringyes

Response

HTTP 200

When successful, the API will return a HTTP status code of 200. In the response you'll find the simulated calculation inputs and the corresponding results. Below you can find an example response for the BMI calculation.

GET/v1/calculations/simulate/bmi
  • json
01{
02 "simulated_calculation_input": {
03 "height": 123,
04 "weight": 41
05 },
06 "simulated_calculation_results": [
07 {
08 "subresult_id": "BMI",
09 "label": {
10 "en": "Body Mass Index"
11 },
12 "unit": {
13 "en": "kg/m2"
14 },
15 "type": "number",
16 "result": 27.100271002710027,
17 "status": "CALCULATED"
18 }
19 ]
20}

HTTP 404

When a calculation for the given calculationId cannot be found, the API will return a 400 HTTP status code and the following response:

  • json
01{
02 "data": {
03 "error": {
04 "message": "Calculation with id \"nonExistentCalculationId\" could not be found."
05 }
06 }
07}

HTTP 500

When unsuccessful, the API will return a 500 HTTP status.