Update Parking Spot
curl --request PUT \
--url https://harbor-parking.vercel.app/api/parking-spots/{id} \
--header 'Content-Type: application/json' \
--data '
{
"spot_number": "<string>",
"building_section": "<string>"
}
'import requests
url = "https://harbor-parking.vercel.app/api/parking-spots/{id}"
payload = {
"spot_number": "<string>",
"building_section": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({spot_number: '<string>', building_section: '<string>'})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'spot_number' => '<string>',
'building_section' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://harbor-parking.vercel.app/api/parking-spots/{id}"
payload := strings.NewReader("{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://harbor-parking.vercel.app/api/parking-spots/{id}")
.header("Content-Type", "application/json")
.body("{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}")
.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::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"spot": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-16",
"owner_id": "456e7890-e89b-12d3-a456-426614174001",
"building_section": "Level 3 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T11:45:00Z"
}
}
Parking Spots
Update Parking Spot
Update parking spot details
PUT
/
api
/
parking-spots
/
{id}
Update Parking Spot
curl --request PUT \
--url https://harbor-parking.vercel.app/api/parking-spots/{id} \
--header 'Content-Type: application/json' \
--data '
{
"spot_number": "<string>",
"building_section": "<string>"
}
'import requests
url = "https://harbor-parking.vercel.app/api/parking-spots/{id}"
payload = {
"spot_number": "<string>",
"building_section": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({spot_number: '<string>', building_section: '<string>'})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'spot_number' => '<string>',
'building_section' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://harbor-parking.vercel.app/api/parking-spots/{id}"
payload := strings.NewReader("{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://harbor-parking.vercel.app/api/parking-spots/{id}")
.header("Content-Type", "application/json")
.body("{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}")
.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::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"spot_number\": \"<string>\",\n \"building_section\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"spot": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-16",
"owner_id": "456e7890-e89b-12d3-a456-426614174001",
"building_section": "Level 3 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T11:45:00Z"
}
}
Overview
This endpoint allows spot owners to update their parking spot details.Authentication
Path Parameters
Unique identifier of the parking spot to update
Request Body
Updated spot number or identifier
Updated building section or location description
Response
Updated parking spot object
Show Spot Object
Show Spot Object
Unique spot identifier (UUID)
Spot number or identifier
ID of the spot owner
Building section or location
Whether the spot has been verified by admin
Spot creation timestamp (ISO 8601)
Spot last update timestamp (ISO 8601)
Example Request
curl -X PUT "https://harbor-parking.vercel.app/api/parking-spots/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"spot_number": "A-16",
"building_section": "Level 3 Parking Garage"
}'
const spotId = "123e4567-e89b-12d3-a456-426614174000";
const response = await fetch(`https://harbor-parking.vercel.app/api/parking-spots/${spotId}`, {
method: 'PUT',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
spot_number: "A-16",
building_section: "Level 3 Parking Garage"
})
});
const result = await response.json();
Example Response
{
"spot": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"spot_number": "A-16",
"owner_id": "456e7890-e89b-12d3-a456-426614174001",
"building_section": "Level 3 Parking Garage",
"is_verified": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T11:45:00Z"
}
}
⌘I