Failure Report
This endpoint provides information about failed parking operations and their reasons for a specific parking location within a given time period.
Description
The Failure report helps you track and analyze unsuccessful parking operations, such as when a parking space was not available during the requested time slot. This information is valuable for identifying patterns in booking failures and improving the parking service.
Endpoint
POST /api/v3/business/report/fail
Authentication
This endpoint requires authentication using a Bearer token.
Headers
| Key | Value |
|---|---|
| Authorization | Bearer Token |
Request Parameters
Body
{
"parkingId": 151, // ID of the parking location
"from": "2025-05-01T04:00:00.000Z", // Start date and time (UTC)
"until": "2025-05-31T03:59:59.999Z" // End date and time (UTC)
}
| Parameter | Type | Description |
|---|---|---|
| parkingId | number | Unique identifier of the parking location |
| from | string | Start date and time in ISO 8601 format (UTC) |
| until | string | End date and time in ISO 8601 format (UTC) |
Response
The response is an array of failure records.
Success Response (200 OK)
[
{
"id": 34238, // Record ID
"userId": 322, // User ID who attempted the operation
"dayis": "2025-05-01T19:56:50.663Z", // Date and time of the failure
"email": "email@example.com", // User's email
"ParkingName": "Estacionamiento Prueba", // Name of the parking location
"City": "Santiago", // City where the parking is located
"description": "Parking no disponible en horario seleccionado" // Reason for failure
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| id | number | Unique identifier for the failure record |
| userId | number | ID of the user who attempted the operation |
| dayis | string | Timestamp of the failure in ISO 8601 format |
| string | Email address of the user | |
| ParkingName | string | Name of the parking location |
| City | string | City where the parking is located |
| description | string | Description of why the operation failed |
Example Usage
cURL
curl -X POST \
'https://api.example.com/api/v3/business/report/fail' \
-H 'Authorization: Bearer your_token_here' \
-H 'Content-Type: application/json' \
-d '{
"parkingId": 151,
"from": "2025-05-01T04:00:00.000Z",
"until": "2025-05-31T03:59:59.999Z"
}'
JavaScript
const response = await fetch('https://api.example.com/api/v3/business/report/fail', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
parkingId: 151,
from: '2025-05-01T04:00:00.000Z',
until: '2025-05-31T03:59:59.999Z'
})
});
const data = await response.json();
Error Responses
400 Bad Request
{
"error": "Invalid date range"
}
401 Unauthorized
{
"error": "Invalid or missing authentication token"
}
404 Not Found
{
"error": "Parking location not found"
}