Saltar al contenido principal

Places vs Available Report

This endpoint provides information about available parking spaces and their status for a specific parking location within a given time period.

Description

The Places vs Available report helps you track the availability status of parking spaces, including information about when spaces are not available and why. This is useful for monitoring parking capacity and identifying patterns in space availability.

Endpoint

POST /api/v3/business/report/available

Authentication

This endpoint requires authentication using a Bearer token.

Headers

KeyValue
AuthorizationBearer Token

Request Parameters

Body

{
"parkingId": 95, // ID of the parking location
"from": "2025-05-30T04:00:00.000Z", // Start date and time (UTC)
"until": "2025-05-31T03:59:59.999Z" // End date and time (UTC)
}
ParameterTypeDescription
parkingIdnumberUnique identifier of the parking location
fromstringStart date and time in ISO 8601 format (UTC)
untilstringEnd date and time in ISO 8601 format (UTC)

Response

The response is an array of availability records.

Success Response (200 OK)

[
{
"id": 52734,
"dayisStart": "23/06/2025 07:00",
"dayisEnd": "23/06/2025 21:00",
"start_booking": "2025-06-23T11:00:00.000Z",
"end_booking": "2025-06-24T01:00:13.000Z",
"last_entry_booking": null,
"parkingSuscriptionId": 121,
"email": "email@email.com",
"ParkingName": "Name Parking",
"Amount": 0,
"userId": 2904,
"City": "Santiago",
"Plate": "AAOO90",
"StatusBooking": "Aceptada"
},
]

Response Fields

FieldTypeDescription
idnumberUnique identifier for the availability record
dayisStartstringStart date and time of the booking period
dayisEndstringEnd date and time of the booking period
start_bookingstringStart booking timestamp in ISO 8601 format
end_bookingstringEnd booking timestamp in ISO 8601 format
last_entry_bookingstringLast entry booking timestamp (can be null)
parkingSuscriptionIdnumberID of the parking subscription
emailstringEmail address of the user
ParkingNamestringName of the parking location
AmountnumberAmount charged for the booking
userIdnumberID of the user associated with the record
CitystringCity where the parking is located
PlatestringLicense plate of the vehicle
StatusBookingstringStatus of the booking (e.g., "Aceptada")

Example Usage

cURL

curl -X POST \
'https://api.example.com/api/v3/business/report/available' \
-H 'Authorization: Bearer your_token_here' \
-H 'Content-Type: application/json' \
-d '{
"parkingId": 95,
"from": "2025-05-30T04:00:00.000Z",
"until": "2025-05-31T03:59:59.999Z"
}'

JavaScript

const response = await fetch('https://api.example.com/api/v3/business/report/available', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
parkingId: 95,
from: '2025-05-30T04: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"
}