Codici QR
Le route dei codici QR di una pagina o di un link breve, e quella dei modelli dello spazio di lavoro. Il codice QR codifica l'indirizzo breve dell'elemento: resta valido se cambi la destinazione o l'indirizzo personalizzato.
- POST
/v1/pages/{id}/qr-codeGenerare un codice QR - POST
/v1/links/{id}/qr-codeGenerare un codice QR - POST
/v1/pages/{id}/qr-code{"template": "none"}Generare senza logo - POST
/v1/links/{id}/qr-code{"template": "none"}Generare senza logo - GET
/v1/pages/{id}/qr-codeLeggere un codice QR - GET
/v1/links/{id}/qr-codeLeggere un codice QR - GET
/v1/pages/{id}/qr-code?format=pngScaricare il file - GET
/v1/links/{id}/qr-code?format=svgScaricare il file - GET
/v1/qr-templatesElencare i modelli - POST
/v1/pages/{id}/qr-code{"template": "QRT_…"}Generare con uno dei tuoi modelli - POST
/v1/links/{id}/qr-code{"template": "QRT_…"}Generare con uno dei tuoi modelli
Generare un codice QR
POST/v1/pages/{id}/qr-code
POST/v1/links/{id}/qr-code
Senza corpo della richiesta, il codice QR è il modello classico: nero su bianco, con il logo TinyLink. Generare di nuovo sostituisce il codice QR precedente. Per un codice QR senza logo o con i tuoi colori, vedi i due blocchi seguenti. Ambito Scrittura.
curl -X POST https://api.tinylink.fr/v1/links/6ac401093831b/qr-code \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code', {
method: 'POST',
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.post(
'https://api.tinylink.fr/v1/links/6ac401093831b/qr-code',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "classic",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Scrittura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Elemento bloccato dalla moderazione
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Generare senza logo
POST/v1/pages/{id}/qr-code{"template": "none"}
POST/v1/links/{id}/qr-code{"template": "none"}
template a "none": nero su bianco, senza il logo TinyLink. Ambito Scrittura.
curl -X POST https://api.tinylink.fr/v1/links/6ac401093831b/qr-code \
-H "Authorization: Bearer tl_il_tuo_token" \
-H "Content-Type: application/json" \
-d '{"template":"none"}'
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code', {
method: 'POST',
headers: {
Authorization: 'Bearer tl_il_tuo_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({ template: 'none' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['template' => 'none']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.post(
'https://api.tinylink.fr/v1/links/6ac401093831b/qr-code',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
json={'template': 'none'},
)
data = response.json()
Risposte possibili
{
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "none",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
} Il corpo non è un oggetto JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Scrittura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Elemento bloccato dalla moderazione
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Leggere un codice QR
GET/v1/pages/{id}/qr-code
GET/v1/links/{id}/qr-code
Gli indirizzi del PNG (2048 px) e dell'SVG. Senza codice QR generato, la risposta è 404 qr_code_not_generated. Ambito Lettura.
curl https://api.tinylink.fr/v1/links/6ac401093831b/qr-code \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/links/6ac401093831b/qr-code',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "classic",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} L'elemento non ha ancora un codice QR
{
"error": {
"code": "qr_code_not_generated",
"message": "No QR code has been generated for this element yet. Use POST on this address to create one."
}
} Elemento bloccato o in fase di verifica
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation: its QR code is not available."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Scaricare il file
GET/v1/pages/{id}/qr-code?format=png
GET/v1/links/{id}/qr-code?format=svg
Con ?format=png o ?format=svg, la risposta non è più JSON ma il file stesso (image/png o image/svg+xml). Ambito Lettura.
curl "https://api.tinylink.fr/v1/links/6ac401093831b/qr-code?format=png" \
-H "Authorization: Bearer tl_il_tuo_token" \
-o qr-promo.png
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code?format=png', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const image = await response.blob();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code?format=png');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
file_put_contents('qr-promo.png', curl_exec($ch));
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/links/6ac401093831b/qr-code?format=png',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
with open('qr-promo.png', 'wb') as f:
f.write(response.content)
Risposte possibili
(le fichier lui-même : image/png ou image/svg+xml) Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} L'elemento non ha ancora un codice QR
{
"error": {
"code": "qr_code_not_generated",
"message": "No QR code has been generated for this element yet. Use POST on this address to create one."
}
} Elemento bloccato o in fase di verifica
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation: its QR code is not available."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Elencare i modelli
GET/v1/qr-templates
I modelli utilizzabili in template: i due modelli TinyLink, poi quelli creati nello spazio di lavoro (Libreria, scheda Codici QR), con la loro forma (square, rounded o dots) e i loro colori (background, foreground). I modelli dello spazio di lavoro compaiono solo con un piano che li comprende, Pro o Business. Ambito Lettura.
curl https://api.tinylink.fr/v1/qr-templates \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/qr-templates', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/qr-templates');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/qr-templates',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"data": [
{
"id": "classic",
"name": "TinyLink",
"description": "Black on white, with the TinyLink logo.",
"shape": "square"
},
{
"id": "none",
"name": "No logo",
"description": "Black on white, without a logo.",
"shape": "square"
},
{
"id": "QRT_6a9f2935302bb",
"name": "Charte 2026",
"description": null,
"shape": "rounded",
"background": "#FFFFFF",
"foreground": "#212121"
}
]
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Generare con uno dei tuoi modelli
POST/v1/pages/{id}/qr-code{"template": "QRT_…"}
POST/v1/links/{id}/qr-code{"template": "QRT_…"}
Passa in template l'identificativo QRT_… restituito dall'elenco dei modelli: il codice QR ne assume la forma, i colori e il logo, e la risposta lo indica in template. Il modello deve appartenere allo spazio di lavoro del token, e il piano deve comprendere i modelli; altrimenti la risposta è 422 validation_failed. Ambito Scrittura.
curl -X POST https://api.tinylink.fr/v1/links/6ac401093831b/qr-code \
-H "Authorization: Bearer tl_il_tuo_token" \
-H "Content-Type: application/json" \
-d '{"template":"QRT_6a9f2935302bb"}'
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code', {
method: 'POST',
headers: {
Authorization: 'Bearer tl_il_tuo_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({ template: 'QRT_6a9f2935302bb' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b/qr-code');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['template' => 'QRT_6a9f2935302bb']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.post(
'https://api.tinylink.fr/v1/links/6ac401093831b/qr-code',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
json={'template': 'QRT_6a9f2935302bb'},
)
data = response.json()
Risposte possibili
{
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "QRT_6a9f2935302bb",
"shape": "rounded",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
} Il corpo non è un oggetto JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Scrittura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Modello assente dallo spazio di lavoro
{
"error": {
"code": "validation_failed",
"message": "Unknown QR code template. Use \"classic\", \"none\" or a template id from GET /v1/qr-templates.",
"details": {
"field": "template"
}
}
} Elemento bloccato dalla moderazione
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
}