List Availabilities
curl --request GET \
--url https://harbor-parking.vercel.app/api/availabilitiesimport requests
url = "https://harbor-parking.vercel.app/api/availabilities"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/availabilities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://harbor-parking.vercel.app/api/availabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://harbor-parking.vercel.app/api/availabilities"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://harbor-parking.vercel.app/api/availabilities")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/availabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"availabilities": [
{
"id": "789e0123-e89b-12d3-a456-426614174002",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"is_claimed": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
Availabilities
List Availabilities
Get availability windows with filtering options
GET
/
api
/
availabilities
List Availabilities
curl --request GET \
--url https://harbor-parking.vercel.app/api/availabilitiesimport requests
url = "https://harbor-parking.vercel.app/api/availabilities"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/availabilities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://harbor-parking.vercel.app/api/availabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://harbor-parking.vercel.app/api/availabilities"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://harbor-parking.vercel.app/api/availabilities")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/availabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"availabilities": [
{
"id": "789e0123-e89b-12d3-a456-426614174002",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"is_claimed": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
Overview
This endpoint retrieves a list of parking spot availability windows with optional filtering capabilities.Authentication
Query Parameters
string
Filter availabilities by specific parking spot ID
string
Filter availabilities by spot owner ID
string
Filter availabilities starting from this date (ISO 8601)
string
Filter availabilities ending before this date (ISO 8601)
number
default:"50"
Maximum number of availabilities to return
number
default:"0"
Number of availabilities to skip for pagination
Response
array
required
Array of availability objects
Show Availability Object
Show Availability Object
string
required
Unique availability identifier (UUID)
string
required
ID of the associated parking spot
string
required
Availability start time (ISO 8601)
string
required
Availability end time (ISO 8601)
boolean
required
Whether this availability has been claimed
string
required
Availability creation timestamp (ISO 8601)
string
required
Availability last update timestamp (ISO 8601)
number
required
Total number of availabilities matching the filters
Example Request
curl -X GET "https://harbor-parking.vercel.app/api/availabilities?limit=10&is_claimed=false" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const response = await fetch('https://harbor-parking.vercel.app/api/availabilities?limit=10&is_claimed=false', {
method: 'GET',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const availabilitiesData = await response.json();
Example Response
{
"availabilities": [
{
"id": "789e0123-e89b-12d3-a456-426614174002",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"is_claimed": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}