Delete Parking Spot
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/parking-spots/{id}import requests
url = "https://harbor-parking.vercel.app/api/parking-spots/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/parking-spots/{id}', 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/parking-spots/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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/parking-spots/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://harbor-parking.vercel.app/api/parking-spots/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/parking-spots/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "Parking spot deleted successfully",
"deleted_spot_id": "123e4567-e89b-12d3-a456-426614174000"
}
Parking Spots
Delete Parking Spot
Remove a parking spot from the system
DELETE
/
api
/
parking-spots
/
{id}
Delete Parking Spot
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/parking-spots/{id}import requests
url = "https://harbor-parking.vercel.app/api/parking-spots/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/parking-spots/{id}', 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/parking-spots/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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/parking-spots/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://harbor-parking.vercel.app/api/parking-spots/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/parking-spots/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "Parking spot deleted successfully",
"deleted_spot_id": "123e4567-e89b-12d3-a456-426614174000"
}
Overview
This endpoint allows spot owners to permanently delete their parking spot from the system.This action is irreversible. All associated availabilities and claims will also be deleted.
Authentication
Path Parameters
Unique identifier of the parking spot to delete
Response
Confirmation message
ID of the deleted parking spot
Example Request
curl -X DELETE "https://harbor-parking.vercel.app/api/parking-spots/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const spotId = "123e4567-e89b-12d3-a456-426614174000";
const response = await fetch(`https://harbor-parking.vercel.app/api/parking-spots/${spotId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const result = await response.json();
Example Response
{
"message": "Parking spot deleted successfully",
"deleted_spot_id": "123e4567-e89b-12d3-a456-426614174000"
}
Error Responses
{
"error": "You can only delete your own parking spots"
}
{
"error": "Parking spot not found"
}
⌘I