curl --request DELETE \
--url https://api.example.com/interests/{id}{
"message": "<string>"
}Remove an interest from the system
curl --request DELETE \
--url https://api.example.com/interests/{id}{
"message": "<string>"
}DELETE /interests/{id}
{
"message": "Interest ID 3 was eliminated succesfully"
}
{
"error": "Interest not found"
}
{
"error": "Cannot delete interest: foreign key constraint violation"
}
{
"error": "Invalid interest ID"
}
const interestId = 3;
const response = await fetch(`http://your-api-base-url.com/interests/${interestId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
});
const result = await response.json();
console.log(result.message);
id parameter must be a valid integer