Get Dashboard
curl --request GET \
--url https://harbor-parking.vercel.app/api/dashboardimport requests
url = "https://harbor-parking.vercel.app/api/dashboard"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/dashboard', 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/dashboard",
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/dashboard"
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/dashboard")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/dashboard")
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{
"stats": {
"total_spots": 2,
"active_spots": 1,
"total_claims": 5,
"active_claims": 1
},
"recent_spots": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-15",
"building_section": "Level 2 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"recent_claims": [
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active"
}
]
}
Dashboard
Get Dashboard
Retrieve user dashboard with comprehensive stats, spots, and claims data
GET
/
api
/
dashboard
Get Dashboard
curl --request GET \
--url https://harbor-parking.vercel.app/api/dashboardimport requests
url = "https://harbor-parking.vercel.app/api/dashboard"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://harbor-parking.vercel.app/api/dashboard', 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/dashboard",
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/dashboard"
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/dashboard")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/dashboard")
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{
"stats": {
"total_spots": 2,
"active_spots": 1,
"total_claims": 5,
"active_claims": 1
},
"recent_spots": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-15",
"building_section": "Level 2 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"recent_claims": [
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active"
}
]
}
Overview
This endpoint retrieves comprehensive dashboard data for the authenticated user, including statistics, parking spots, recent claims, and availability information.Authentication
Response
Dashboard statistics
Array of user’s most recent parking spots
Array of user’s most recent claims
Example Request
curl -X GET "https://harbor-parking.vercel.app/api/dashboard" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const response = await fetch('https://harbor-parking.vercel.app/api/dashboard', {
method: 'GET',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const dashboardData = await response.json();
Example Response
{
"stats": {
"total_spots": 2,
"active_spots": 1,
"total_claims": 5,
"active_claims": 1
},
"recent_spots": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-15",
"building_section": "Level 2 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"recent_claims": [
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"spot_id": "123e4567-e89b-12d3-a456-426614174000",
"start_time": "2024-01-16T09:00:00Z",
"end_time": "2024-01-16T17:00:00Z",
"status": "active"
}
]
}
⌘I