Delete Claim
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/claims/{id}import requests
url = "https://harbor-parking.vercel.app/api/claims/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/claims/{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/claims/{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/claims/{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/claims/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/claims/{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": "Claim cancelled successfully",
"deleted_claim_id": "abc123de-e89b-12d3-a456-426614174003"
}
Claims
Delete Claim
Cancel a parking spot claim
DELETE
/
api
/
claims
/
{id}
Delete Claim
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/claims/{id}import requests
url = "https://harbor-parking.vercel.app/api/claims/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/claims/{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/claims/{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/claims/{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/claims/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/claims/{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": "Claim cancelled successfully",
"deleted_claim_id": "abc123de-e89b-12d3-a456-426614174003"
}
Overview
This endpoint allows users to delete (cancel) their parking spot claims.Deleting a claim will free up the associated availability for other users to claim.
Authentication
Path Parameters
Response
Example Request
curl -X DELETE "https://harbor-parking.vercel.app/api/claims/abc123de-e89b-12d3-a456-426614174003" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const claimId = "abc123de-e89b-12d3-a456-426614174003";
const response = await fetch(`https://harbor-parking.vercel.app/api/claims/${claimId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const result = await response.json();
Example Response
{
"message": "Claim cancelled successfully",
"deleted_claim_id": "abc123de-e89b-12d3-a456-426614174003"
}
Side Effects
When a claim is deleted:- The associated availability becomes available for other users to claim
- Any notifications related to this claim are marked as resolved
- The parking spot owner is notified of the cancellation
Error Responses
{
"error": "You can only delete your own claims"
}
{
"error": "Claim not found"
}
{
"error": "Cannot delete a completed claim"
}