List Claims
curl --request GET \
--url https://harbor-parking.vercel.app/api/claimsimport requests
url = "https://harbor-parking.vercel.app/api/claims"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/claims', 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/claims",
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/claims"
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/claims")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/claims")
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{
"claims": [
{
"id": "abc123de-e89b-12d3-a456-426614174003",
"availability_id": "789e0123-e89b-12d3-a456-426614174002",
"claimer_id": "456e7890-e89b-12d3-a456-426614174001",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
Claims
List Claims
Get claims with filtering options
GET
/
api
/
claims
List Claims
curl --request GET \
--url https://harbor-parking.vercel.app/api/claimsimport requests
url = "https://harbor-parking.vercel.app/api/claims"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/claims', 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/claims",
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/claims"
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/claims")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/claims")
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{
"claims": [
{
"id": "abc123de-e89b-12d3-a456-426614174003",
"availability_id": "789e0123-e89b-12d3-a456-426614174002",
"claimer_id": "456e7890-e89b-12d3-a456-426614174001",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active",
"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 claims with optional filtering capabilities.Authentication
Query Parameters
Filter claims by claimer (user) ID
Filter claims by specific parking spot ID
Filter claims by status (active, completed, cancelled)
Filter claims starting from this date (ISO 8601)
Filter claims ending before this date (ISO 8601)
Maximum number of claims to return
Number of claims to skip for pagination
Response
Array of claim objects
Show Claim Object
Show Claim Object
Unique claim identifier (UUID)
ID of the claimed availability
ID of the user who made the claim
Claim start time (ISO 8601)
Claim end time (ISO 8601)
Claim status (active, completed, cancelled)
Claim creation timestamp (ISO 8601)
Claim last update timestamp (ISO 8601)
Total number of claims matching the filters
Example Request
curl -X GET "https://harbor-parking.vercel.app/api/claims?status=active&limit=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const response = await fetch('https://harbor-parking.vercel.app/api/claims?status=active&limit=10', {
method: 'GET',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const claimsData = await response.json();
Example Response
{
"claims": [
{
"id": "abc123de-e89b-12d3-a456-426614174003",
"availability_id": "789e0123-e89b-12d3-a456-426614174002",
"claimer_id": "456e7890-e89b-12d3-a456-426614174001",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
⌘I