/utilities
GET /durationEstimate
You can estimate the number of hours worked from a surface
Query Parameters
surface
required : The surface in square meter (m²). Must be between 1 et 400
Result
Returns a JSON Object with the following properties
duration
: the duration in hours (decimal)surface
: the corresponding surface (integer)
Example
Request :
GET https://dev.tidybear.fr:8443/tidybear/utilities/durationEstimate?surface=40
Response :
{
"duration": 2.5,
"surface": 40
}
GET /priceEstimate
You can estimate the price from the number of hours worked
Query Parameters
duration
required : The number of hours worked (decimal)discountCode
optional : The discount code, required ifbookingTime
is set (string)bookingTime
optional : The timestamp of the booking time in milliseconds, required ifdiscountCode
is set (double)services
optional : The additional services (string[])
Result
Returns a JSON Object with the following properties
duration
: the duration in hours (decimal)price
: the corresponding price in cents (integer ex : 8000 corresponds to 80,00€)
Examples
Request :
GET https://dev.tidybear.fr:8443/tidybear/utilities/priceEstimate?duration=4
Response :
{
"duration": 4,
"price": 8000
}
Request :
GET https://dev.tidybear.fr:8443/tidybear/utilities/priceEstimate?duration=4&discountCode=TIDYCODE&bookingTime=1464101990000
Response :
{
"duration": 4,
"price": 6000
}
GET /durationByPartnerEstimate
You can estimate the number of necessary Tidybear partners to make the work
Query Parameters
duration
required : The number of hours worked (decimal)
Result
Returns a JSON Object with the following properties
totalDuration
: the total duration in hours (decimal)nbPartners
: the corresponding number of necessary Tidybear partner (integer)durationByPartner
: the number of hours worked by Tidybear partner (decimal)
Example
Request :
GET https://dev.tidybear.fr/tidybear/utilities/durationByPartnerEstimate?duration=6
Response :
{
"totalDuration": 6,
"nbPartners": 2,
"durationByPartner": 3
}
GET /discountValidity
You can know whether a discount code is valid for a specific booking time
Query Parameters
discountCode
required : The discount code (string)bookingTime
required : The timestamp of the booking time in milliseconds (double)
Result
Returns nothing, you need to take a look to the HTTP response code
204
: The discount code is valid404
: The discount code is not found
Example
Request :
GET https://dev.tidybear.fr/tidybear/utilities/discountValidity?discountCode=TIDYCODE&bookingTime=1464103050000
Response :
204
: The discount code is valid404
: The discount code is not found