curl --request DELETE \
--url https://api.example.com/reserve/delete \
--header 'Content-Type: application/json' \
--data '
{
"v_id_reservation": "<string>"
}
'{
"message": "Eliminacion Exitosa"
}
Delete an existing reservation from the system
curl --request DELETE \
--url https://api.example.com/reserve/delete \
--header 'Content-Type: application/json' \
--data '
{
"v_id_reservation": "<string>"
}
'{
"message": "Eliminacion Exitosa"
}
access_token cookie.
"RSV00123"{
"message": "Eliminacion Exitosa"
}
v_id_reservation fieldaccess_token cookie is present.curl -X DELETE https://api.demet.com/reserve/delete \
-H "Content-Type: application/json" \
-b "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{
"v_id_reservation": "RSV00123"
}'
// First, get the reservation
const getResponse = await fetch('https://api.demet.com/reserve/get', {
credentials: 'include'
});
const reservations = await getResponse.json();
const reservation = reservations.result.find(r => r.id_reservation === 'RSV00123');
// Show user the details and confirm
if (confirm(`Delete reservation for ${reservation.name}?`)) {
// Then delete
const deleteResponse = await fetch('https://api.demet.com/reserve/delete', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ v_id_reservation: 'RSV00123' })
});
}
try {
const response = await fetch('https://api.demet.com/reserve/delete', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ v_id_reservation: 'RSV00123' })
});
if (response.status === 404) {
console.log('Reservation was already deleted');
} else if (response.ok) {
console.log('Reservation deleted successfully');
}
} catch (error) {
console.error('Error deleting reservation:', error);
}