API reference
Retrieve calculation details for a single calculation
GET/v1/calculations/{calculationId}
This endpoint expects a calculationId
to be passed as a path parameter. If not provided, the query will return all calculations.
Parameter | Type | Required |
---|---|---|
calculationId | string | yes |
When successful, the API will return a HTTP status code of 200 and in the response a single calculation object. The schema of the response can be found here.
Below you can find an example response of the bmi calculation:
- json
01{02 "calculation_id": "bmi",03 "calculation_name": {04 "en": "BMI (metric)"05 },06 "calculation_description": {07 "en": "<h1 id=\"bodymassindexbmi\">Body Mass Index (BMI)</h1>..."08 },09 "calculation_blueprint": {10 "input_definition": [11 {12 "id": "height",13 "label": {14 "nl": "Lengte",15 "en": "Height",16 "fr": "Longueur",17 "de": "Länge"18 },19 "input_type": {20 "type": "number",21 "range": {22 "min": {23 "value": 2024 },25 "max": {26 "value": 30027 }28 }29 },30 "format": "cm"31 },32 {33 "id": "weight",34 "label": {35 "nl": "Gewicht",36 "en": "Weight",37 "fr": "Poids",38 "de": "Gewicht"39 },40 "input_type": {41 "type": "number",42 "range": {43 "min": {44 "value": 1045 },46 "max": {47 "value": 30048 }49 }50 },51 "format": "kg"52 }53 ],54 "output_definition": [55 {56 "subresult_id": "BMI",57 "label": {58 "en": "Body Mass Index"59 },60 "unit": {61 "en": "kg/m2"62 },63 "type": "number"64 }65 ]66 },67 "is_private": false68}
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}
When unsuccessful, the API will return a 500 HTTP status.