The createQrCodeHandler creates a qr code for the input body and returns the reponse to users
# cURL
curl -X DELETE \
'https://divsly-backend.vercel.app/api/v1/qr-code/123' \
-H 'Authorization: Bearer YOUR_TOKEN_HERE'
// JavaScript Fetch
const qrCodeId = '123';
fetch(`https://divsly-backend.vercel.app/api/v1/qr-code/${qrCodeId}`, {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
// Axios (Node.js)
const axios = require('axios');
const qrCodeId = '123';
axios.delete(`https://divsly-backend.vercel.app/api/v1/qr-code/${qrCodeId}`, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
})
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
// PHP
$qrCodeId = '123';
$ch = curl_init("https://divsly-backend.vercel.app/api/v1/qr-code/{$qrCodeId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer YOUR_TOKEN_HERE'
));
$response = curl_exec($ch);
$result = json_decode($response, true);
curl_close($ch);
print_r($result);
# Python (requests)
import requests
qr_code_id = '123'
headers = {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
response = requests.delete(
f'https://divsly-backend.vercel.app/api/v1/qr-code/{qr_code_id}',
headers=headers
)
print(response.json())
{
"message": "QR Code Deleted successfully",
"success": true,
"result": {
"id": 123,
"type": "shortlink",
"type2": null,
"userId": 6,
"clicks": 0,
"lbClicks": 0,
"scans": 0,
"destinationUrl": "https://example.com",
"faviconUrl": "",
"title": "Updated QR Code",
"titleLabel": "updated qr code",
"btnLabel": null,
"brandedDomain": "kut.lt",
"slashTag": "i5qkc",
"edit": 1,
"utm_id": null,
"utm_content": null,
"utm_term": null,
"utm_campaign": null,
"utm_medium": null,
"utm_source": null,
"preset": null,
"bgColor": null,
"color": null,
"pattern": null,
"corner": null,
"logo": null,
"qr": null,
"qrLogoId": null,
"tags": "TestMultiplesites",
"linkInBioId": null,
"uniqueTagId": 126,
"isActive": true,
"isStarred": false,
"expirationDate": "2025-06-25T06:21:29.854Z",
"createdAt": "2025-01-24T10:11:26.423Z",
"updatedAt": "2025-03-27T06:35:35.695Z",
"fieldData": null,
"frame": null,
"isadminblocked": false,
"isEdit": true,
"password": null,
"passwordProtectionEnabled": false,
"primary": null,
"qrType": null,
"secondary": null,
"text": null,
"textColor": null
}
}
{
"message": "Unauthorized!"
}
{ success: false, error: “Error deleting QR code }