API reference
Pass calculation inputs and get back the results of the calculation
POST
This endpoint expects the below fields to be present in the request body.
Field | Type | Required |
---|---|---|
calculation_id | string | yes |
calculation_input | object (key-value pair) | yes |
The calculation_input
parameter expects a key-value pair object where the key represents the calculation input id and the value is the corresponding value for that calculation input.
01
When successful, the API will return a HTTP status code of 200 and in the response an array of results. We return an array of results because some calculations return multiple "subresults" instead of a single score. The schema of the response can be found here.
Below you can find an example response of the bmi calculation:
01
When you try to perform a calculation that doesn't exist (based on the calculation_id
), the API will return a 404 HTTP status code and the following response:
01
When unsuccessful, the API will return a 500 HTTP status.
This error is thrown when you're passing at least 1 invalid value for a given calculation input id.
Request:
01
Response:
01
This error is thrown when you're passing at least 1 unexpected calculation input id for a given calculation.
Request:
01
Response:
01