Backend integration
APIs provided by Mileus
For all endpoints the RH operator needs to provide their API key in the api-key
header.
Authentication service
The detailed documentation of the authentication API endpoint is available in the API specification.
/auth/v1/token
Authentication endpoint, used for retrieving the auth token which is then passed to the frontend RH app. This is not relevant to the backend integration flow, but the RH backend needs to provide the Watchdog auth API endpoint for the frontend app to make this call to Mileus auth.
Watchdog service
The detailed documentation of the API endpoints is available in the API specification.
/watchdog/v1/order/driver-accept
The RH operator calls this API if the driver accepts the order created via the Order create API which means that the ride can be offered to the passenger.
Request payload:
orderId
- ID of the order (as previously returned by the Order create API of the RH operator)driverId
- ID of the driver that will be fulfilling the order, in V1 for this call to succeed it has to match thedriverId
provided to Order create API in request payload by MileusdriverEta
- estimated date-time of driver's arrival to the pickup locationcost
- object containingvalue
andcurrency
properties, defines the cost of the ride (it can be just an estimate)driverDetails
- object containing information about the ride, such as name of the driver, car model, … (the full object description can be found in the API specification)
/watchdog/v1/order/driver-cancel
The RH operator calls this API in two cases:
- if the driver refuses to accept the order created via the Order create API
- if the driver cancels the order anytime (even after the ride has been offered or even confirmed by the passenger)
Request payload:
orderId
- ID of the order (as previously returned by the Order create API of the RH operator)
/watchdog/v1/order/confirm
This API is used by the RH operator if the provided Order accept API works asynchronously, it's called after the processing of the order acceptance from the passenger side has been completed so that Mileus knows the result. If this API is not called before the OrderConfirmationTimeout occurs, the order is canceled from the Mileus side.
Request payload:
orderId
- ID of the order (as previously returned by the Order create API of the RH operator)status
-OK
if the order has been successfully confirmed by the RH operator, orERROR
if the confirmation failed (for example the driver has canceled the order in the meantime)