Update User Profile
curl --request PUT \
--url https://harbor-parking.vercel.app/api/profile \
--header 'Content-Type: application/json' \
--data '
{
"full_name": "<string>",
"apartment_number": "<string>",
"phone_number": "<string>"
}
'import requests
url = "https://harbor-parking.vercel.app/api/profile"
payload = {
"full_name": "<string>",
"apartment_number": "<string>",
"phone_number": "<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({full_name: '<string>', apartment_number: '<string>', phone_number: '<string>'})
};
fetch('https://harbor-parking.vercel.app/api/profile', 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/profile",
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([
'full_name' => '<string>',
'apartment_number' => '<string>',
'phone_number' => '<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/profile"
payload := strings.NewReader("{\n \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<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/profile")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/profile")
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 \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "john.doe@example.com",
"full_name": "John Doe",
"apartment_number": "12A",
"phone_number": "+1234567890",
"is_approved": true,
"is_admin": false,
"updated_at": "2024-01-15T10:30:00Z"
}
}
Profile & Authentication
Update User Profile
Update the authenticated user’s profile information
PUT
/
api
/
profile
Update User Profile
curl --request PUT \
--url https://harbor-parking.vercel.app/api/profile \
--header 'Content-Type: application/json' \
--data '
{
"full_name": "<string>",
"apartment_number": "<string>",
"phone_number": "<string>"
}
'import requests
url = "https://harbor-parking.vercel.app/api/profile"
payload = {
"full_name": "<string>",
"apartment_number": "<string>",
"phone_number": "<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({full_name: '<string>', apartment_number: '<string>', phone_number: '<string>'})
};
fetch('https://harbor-parking.vercel.app/api/profile', 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/profile",
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([
'full_name' => '<string>',
'apartment_number' => '<string>',
'phone_number' => '<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/profile"
payload := strings.NewReader("{\n \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<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/profile")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/profile")
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 \"full_name\": \"<string>\",\n \"apartment_number\": \"<string>\",\n \"phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "john.doe@example.com",
"full_name": "John Doe",
"apartment_number": "12A",
"phone_number": "+1234567890",
"is_approved": true,
"is_admin": false,
"updated_at": "2024-01-15T10:30:00Z"
}
}
Overview
This endpoint allows authenticated users to update their profile information such as full name, apartment number, and phone number.Authentication
Request Body
string
User’s full name
string
User’s apartment number in the building
string
User’s phone number
Response
object
required
Updated user profile information
Show Profile Object
Show Profile Object
string
required
Unique profile identifier (UUID)
string
required
User’s email address
string
User’s full name (optional)
string
required
User’s apartment number in the building
string
User’s phone number (optional)
boolean
required
Whether the user has been approved by a building administrator
boolean
required
Whether the user has administrator privileges
string
required
Profile last update timestamp (ISO 8601)
Example Request
curl -X PUT "https://harbor-parking.vercel.app/api/profile" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"full_name": "John Doe",
"apartment_number": "12A",
"phone_number": "+1234567890"
}'
const response = await fetch('https://harbor-parking.vercel.app/api/profile', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
full_name: "John Doe",
apartment_number: "12A",
phone_number: "+1234567890"
})
});
const result = await response.json();
Example Response
{
"profile": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "john.doe@example.com",
"full_name": "John Doe",
"apartment_number": "12A",
"phone_number": "+1234567890",
"is_approved": true,
"is_admin": false,
"updated_at": "2024-01-15T10:30:00Z"
}
}