POST /api/v1/qrcodes
Enable QR code generation for a specific short_code or update its settings.
Body JSON
{"short_code":"Ab3xK9q"}
Plan rule: on Free plan, custom_code is ignored and a random short code is generated automatically.
Response 201
{"short_code":"Ab3xK9q","has_qr":1,"message":"QR Code abilitato per il link selezionato."}
GET /api/v1/qrcodes
Retrieve the list of all short links for which a QR code has been enabled.
Response 200
{"data":[{"short_code":"abc123","destination_url":"https://example.com","title":"Landing","has_qr":1}]}
PHP smoke example
Full smoke-style example for QR Codes endpoints (replace placeholder with your API key).
<?php
declare(strict_types=1);
$baseUrl = 'https://tapy.cc';
$apiKey = 'YOUR_API_KEY'; // replace with your key
function request_json(string $method, string $url, string $apiKey, ?array $payload = null): array
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$headers = [
'Accept: application/json',
'X-API-Key: ' . $apiKey,
];
if ($payload !== null) {
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload, JSON_UNESCAPED_SLASHES));
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$raw = curl_exec($ch);
$status = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
return [$status, json_decode((string) $raw, true) ?: ['raw' => $raw]];
}
// Step 1 – Create a short link first
[$createStatus, $createBody] = request_json('POST', $baseUrl . '/api/v1/shorten', $apiKey, [
'url' => 'https://example.com',
'title' => 'QR Demo',
]);
echo "POST /api/v1/shorten => HTTP {$createStatus}\n";
print_r($createBody);
$code = (string) $createBody['short_code'];
// Step 2 – Enable QR code for this link
[$qrStatus, $qrBody] = request_json('POST', $baseUrl . '/api/v1/qrcodes', $apiKey, [
'short_code' => $code,
]);
echo "POST /api/v1/qrcodes => HTTP {$qrStatus}\n";
print_r($qrBody);
// Step 3 – List all QR-enabled links
[$listStatus, $listBody] = request_json('GET', $baseUrl . '/api/v1/qrcodes', $apiKey);
echo "GET /api/v1/qrcodes => HTTP {$listStatus}\n";
print_r($listBody);