Error Scenarios
14 API calls in this section.
Collection of error scenarios and edge cases for testing the Route Calculation API.
Unauthorized Access
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Test unauthorized access without authentication token.
Expected Response
Status: 401 Unauthorized
Message: Authentication required
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Content-Type | string | Example: |
Authorization | string | Example: |
Response examples
1{2 "success": false,3 "message": "Authentication required"4}Invalid Driver ID
/route/for-driver/invalid-uuid/delivery/{{delivery_id}}Test with invalid driver ID format.
Expected Response
Status: 400 Bad Request
Message: Invalid driver ID format
Path parameters
| Parameter | Type | Description |
|---|---|---|
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/invalid-uuid/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid driver ID format"4}Invalid Delivery ID
/route/for-driver/{{driver_id}}/delivery/invalid-uuidTest with invalid delivery ID format.
Expected Response
Status: 400 Bad Request
Message: Invalid delivery ID format
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/invalid-uuid" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid delivery ID format"4}Invalid Coordinates
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Test with invalid coordinate values (out of valid range).
Expected Response
Status: 400 Bad Request
Message: Invalid coordinates
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
current_lat | string | Invalid latitude (out of range) Example: |
current_lng | string | Invalid longitude (out of range) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}?current_lat=91¤t_lng=181" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid coordinates"4}Driver Not Found
/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/{{delivery_id}}Test with non-existent driver ID.
Expected Response
Status: 404 Not Found
Message: Driver not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Driver not found"4}Delivery Not Found
/route/for-driver/{{driver_id}}/delivery/00000000-0000-0000-0000-000000000000Test with non-existent delivery ID.
Expected Response
Status: 404 Not Found
Message: Delivery not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/00000000-0000-0000-0000-000000000000" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Delivery not found"4}Google Maps API Error
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Simulate Google Maps API error scenarios (when API key is invalid, quota exceeded, etc.).
No-route contract
Google Maps ZERO_RESULTS returns HTTP 404 with stable code=no_route_found and a localized plain-language message; it is not an internal server error. Frontends should display message, may branch on code, and should not retry the same coordinates as a server failure. The driver and delivery IDs remain unchanged and no navigation action is required.
Other possible error responses
API quota exceeded
Invalid API key
Location not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "API quota exceeded"4}Unauthorized Access
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Test unauthorized access without authentication token.
Expected Response
Status: 401 Unauthorized
Message: Authentication required
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Content-Type | string | Example: |
Authorization | string | Example: |
Response examples
1{2 "success": false,3 "message": "Authentication required"4}Invalid Driver ID
/route/for-driver/invalid-uuid/delivery/{{delivery_id}}Test with invalid driver ID format.
Expected Response
Status: 400 Bad Request
Message: Invalid driver ID format
Path parameters
| Parameter | Type | Description |
|---|---|---|
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/invalid-uuid/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid driver ID format"4}Invalid Delivery ID
/route/for-driver/{{driver_id}}/delivery/invalid-uuidTest with invalid delivery ID format.
Expected Response
Status: 400 Bad Request
Message: Invalid delivery ID format
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/invalid-uuid" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid delivery ID format"4}Invalid Coordinates
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Test with invalid coordinate values (out of valid range).
Expected Response
Status: 400 Bad Request
Message: Invalid coordinates
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
current_lat | string | Invalid latitude (out of range) Example: |
current_lng | string | Invalid longitude (out of range) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}?current_lat=91¤t_lng=181" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Invalid coordinates"4}Driver Not Found
/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/{{delivery_id}}Test with non-existent driver ID.
Expected Response
Status: 404 Not Found
Message: Driver not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/00000000-0000-0000-0000-000000000000/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Driver not found"4}Delivery Not Found
/route/for-driver/{{driver_id}}/delivery/00000000-0000-0000-0000-000000000000Test with non-existent delivery ID.
Expected Response
Status: 404 Not Found
Message: Delivery not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/00000000-0000-0000-0000-000000000000" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "Delivery not found"4}Google Maps API Error
/route/for-driver/{{driver_id}}/delivery/{{delivery_id}}Simulate Google Maps API error scenarios (when API key is invalid, quota exceeded, etc.).
No-route contract
Google Maps ZERO_RESULTS returns HTTP 404 with stable code=no_route_found and a localized plain-language message; it is not an internal server error. Frontends should display message, may branch on code, and should not retry the same coordinates as a server failure. The driver and delivery IDs remain unchanged and no navigation action is required.
Other possible error responses
API quota exceeded
Invalid API key
Location not found
Path parameters
| Parameter | Type | Description |
|---|---|---|
driver_idRequired | string | Variable used inside the request path. |
delivery_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/route/for-driver/${DRIVER_ID}/delivery/${DELIVERY_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
1{2 "success": false,3 "message": "API quota exceeded"4}