/api/link/:id
Added in v1.0
DELETE
https://api.example.com/api/link/:id
Requires authentication:
X-API-Key: YOUR_API_KEY
Delete a link from the system and returns the final data before it's removed.
Headers
-
x-api-keystring requiredAPI key used to authenticate the requestExample:Your actual API key
Path parameters
-
idstring requiredThe numerical ID of the link to deleteExample:1
Responses
- 200Success
- 400Success
Request
curl -X DELETE 'https://api.example.com/api/link/1' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'x-api-key: Your actual API key'
const response = await fetch('https://api.example.com/api/link/1', {
method: 'DELETE',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'x-api-key': 'Your actual API key',
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.delete(
"https://api.example.com/api/link/1",
headers={
"X-API-Key": "YOUR_API_KEY",
"x-api-key": "Your actual API key",
},
)
print(response.json())
<?php
$ch = curl_init('https://api.example.com/api/link/1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY',
'x-api-key: Your actual API key',
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Response
Success
{
"id": 2,
"name": "g",
"url": "https://google.com",
"count": 0,
"creator": "API",
"creatorID": "0",
"createdAt": "1713090722076"
}
Success
{
"msg": "Link not found from the ID"
}