You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-due-date
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "firstDayOfLastPeriod": "2023-01-01", "cycleLength": 36 }
The API will respond with a JSON object containing the calculated values as shown in the following example:
{ "results": [ { "dueDate": "2023-10-16", "numberOfDays": 174, "numberOfWeeks": 24, "remainingDays": 6, "currentWeek": 25, "months": 5, "DaysMonth": 24, "trimstre": "second", "percentageof40week": 62 } ] }
If the request is missing the required properties (firstDayOfLastPeriod or cycleLength), the API will respond with a 400 Bad Request status code and an error message.
If the weight or height is negative, the API will also respond with a 400 Bad Request status code and an error message.
curl -X POST -H "Content-Type: application/json" -d '{"firstDayOfLastPeriod":"2023-01-01","cycleLength":36}' https://do-calculate.com/api/calculate-due-date