Apparence d'une page
Les couleurs, polices, disposition, logo et bannière d'une page : les réglages de son onglet Apparence. Une page a ses propres réglages, ou suit un style de page : elle prend alors l'apparence du style, bannière comprise. Ses propres réglages ne sont pas perdus pour autant : détachée du style, elle les retrouve.
- GET
/v1/pages/{id}/styleLire l'apparence - PATCH
/v1/pages/{id}/styleModifier l'apparence - PATCH
/v1/pages/{id}/styleAppliquer ou retirer un style - PUT
/v1/pages/{id}/logoChanger le logo - POST
/v1/pages/{id}/logoChanger le logo - PUT
/v1/pages/{id}/bannerChanger la bannière - POST
/v1/pages/{id}/bannerChanger la bannière - DELETE
/v1/pages/{id}/logoRetirer le logo ou la bannière - DELETE
/v1/pages/{id}/bannerRetirer le logo ou la bannière - GET
/v1/fontsLister les polices
Lire l'apparence
GET/v1/pages/{id}/style
Les réglages appliqués à la page (ceux du style si elle en suit un), le style suivi (null sinon), la bannière en ses deux formats — classic (1 200 × 630) et wide (1 200 × 400) — et le logo. Portée Lecture.
curl https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style \
-H "Authorization: Bearer tl_votre_jeton"
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style', {
headers: { Authorization: 'Bearer tl_votre_jeton' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style',
headers={'Authorization': 'Bearer tl_votre_jeton'},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": null,
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "metroblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#FFFFFF",
"button_title_color": "#212121",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "rounded",
"background_color": "#F0F0F0",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": null,
"logo": null
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Lecture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Modifier l'apparence
PATCH/v1/pages/{id}/style
Dans settings, n'envoyez que les réglages à changer ; les autres gardent leur valeur. Une valeur refusée est signalée, jamais remplacée en silence. Refusé si la page suit un style : détachez-la d'abord. Portée Écriture.
header_layout—classic(en-tête coloré) oubanner(bannière en tête) ;logo_size—small,mediumoulargeheader_text_size,button_text_size,section_text_size—small,mediumoulargeheader_color,header_title_color,header_description_color,header_icon_color— couleurs de l'en-têtebutton_color,button_title_color,button_description_color— couleurs des liens ;button_radius—circular,roundedousquarebackground_color— fond de la page ;section_title_color,section_description_color— titres de sectionheader_title_font,header_description_font,button_title_font,button_description_font,section_title_font,section_description_font— identifiants deGET /v1/fonts- Couleurs en hexadécimal :
#1E90FFou#19F.
curl -X PATCH https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style \
-H "Authorization: Bearer tl_votre_jeton" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"background_color": "#F3EADF",
"button_color": "#1E90FF",
"button_title_color": "#FFFFFF",
"button_radius": "circular",
"header_title_font": "poppinsblack"
}
}'
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style', {
method: 'PATCH',
headers: {
Authorization: 'Bearer tl_votre_jeton',
'Content-Type': 'application/json',
},
body: JSON.stringify({
settings: {
background_color: '#F3EADF',
button_color: '#1E90FF',
button_title_color: '#FFFFFF',
button_radius: 'circular',
header_title_font: 'poppinsblack',
},
}),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'settings' => [
'background_color' => '#F3EADF',
'button_color' => '#1E90FF',
'button_title_color' => '#FFFFFF',
'button_radius' => 'circular',
'header_title_font' => 'poppinsblack',
],
]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.patch(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style',
headers={'Authorization': 'Bearer tl_votre_jeton'},
json={
'settings': {
'background_color': '#F3EADF',
'button_color': '#1E90FF',
'button_title_color': '#FFFFFF',
'button_radius': 'circular',
'header_title_font': 'poppinsblack',
},
},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": null,
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "poppinsblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#1E90FF",
"button_title_color": "#FFFFFF",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "circular",
"background_color": "#F3EADF",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": null,
"logo": null
} Le corps n'est pas un objet JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Écriture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} La page suit un style de page
{
"error": {
"code": "page_style_linked",
"message": "This page follows the page style \"Dark\": its appearance comes from the style. Unlink it first with PATCH /v1/pages/{id}/style and \"style_id\": null, or edit the style."
}
} Aucun champ modifiable dans le corps
{
"error": {
"code": "validation_failed",
"message": "Nothing to update. Accepted fields: style_id, keep_appearance, settings."
}
} Réglage d'apparence inconnu
{
"error": {
"code": "validation_failed",
"message": "Unknown setting \"shadow\". Accepted: header_layout, logo_size, header_text_size, header_color, header_title_color, header_description_color, header_icon_color, header_title_font, header_description_font, button_text_size, button_color, button_title_color, button_description_color, button_title_font, button_description_font, button_radius, background_color, section_text_size, section_title_color, section_title_font, section_description_color, section_description_font.",
"details": {
"field": "settings.shadow"
}
}
} Valeur refusée pour un réglage (couleur, police, liste)
{
"error": {
"code": "validation_failed",
"message": "The \"button_color\" setting must be a hexadecimal colour such as #1E90FF.",
"details": {
"field": "settings.button_color"
}
}
} Élément bloqué par la modération
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Appliquer ou retirer un style
PATCH/v1/pages/{id}/style
style_id rattache la page à un style de l'environnement ou à un style fourni (default, light, dark…, voir GET /v1/page-styles). "style_id": null la détache : elle retrouve ses propres réglages ; ajoutez "keep_appearance": true pour qu'elle garde plutôt l'apparence du style, recopiée dans ses réglages. Portée Écriture.
curl -X PATCH https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style \
-H "Authorization: Bearer tl_votre_jeton" \
-H "Content-Type: application/json" \
-d '{"style_id":"PST6ad34a11d00877"}'
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style', {
method: 'PATCH',
headers: {
Authorization: 'Bearer tl_votre_jeton',
'Content-Type': 'application/json',
},
body: JSON.stringify({ style_id: 'PST6ad34a11d00877' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['style_id' => 'PST6ad34a11d00877']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.patch(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/style',
headers={'Authorization': 'Bearer tl_votre_jeton'},
json={'style_id': 'PST6ad34a11d00877'},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": {
"id": "PST6ad34a11d00877",
"name": "Charte 2026",
"builtin": false
},
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "metroblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#1E90FF",
"button_title_color": "#FFFFFF",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "circular",
"background_color": "#F0F0F0",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": null,
"logo": "https://content.tinylink.fr/page-logo/logo_6ad34a0fd937d.webp"
} Le corps n'est pas un objet JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Écriture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Style absent de l'environnement
{
"error": {
"code": "validation_failed",
"message": "Unknown page style. Use an id from GET /v1/page-styles.",
"details": {
"field": "style_id"
}
}
} « style_id » et « settings » envoyés ensemble
{
"error": {
"code": "validation_failed",
"message": "Send either \"style_id\" or \"settings\": a page that follows a style takes its appearance from the style.",
"details": {
"field": "settings"
}
}
} Élément bloqué par la modération
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Changer le logo
PUT/v1/pages/{id}/logo
POST/v1/pages/{id}/logo
image : l'adresse publique d'une image, ou une data URI base64 (data:image/png;base64,…). Pour envoyer un fichier, utilisez POST en multipart/form-data avec un champ image. JPEG, PNG ou WebP, 5 Mo et 6 000 px de côté au plus. Le logo est recadré en carré de 350 px ; crop.square ({"x", "y", "w", "h"}, en pixels de l'image d'origine) choisit la zone, sinon elle est centrée. La réponse est l'apparence de la page. Portée Écriture.
curl -X PUT https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo \
-H "Authorization: Bearer tl_votre_jeton" \
-H "Content-Type: application/json" \
-d '{"image":"https://exemple.fr/logo.png"}'
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo', {
method: 'PUT',
headers: {
Authorization: 'Bearer tl_votre_jeton',
'Content-Type': 'application/json',
},
body: JSON.stringify({ image: 'https://exemple.fr/logo.png' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['image' => 'https://exemple.fr/logo.png']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.put(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo',
headers={'Authorization': 'Bearer tl_votre_jeton'},
json={'image': 'https://exemple.fr/logo.png'},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": null,
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "poppinsblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#1E90FF",
"button_title_color": "#FFFFFF",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "circular",
"background_color": "#F3EADF",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": null,
"logo": "https://content.tinylink.fr/page-logo/logo_6ad34a0fd937d.webp"
} Le corps n'est pas un objet JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Écriture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Image illisible, trop lourde ou d'un format refusé
{
"error": {
"code": "invalid_image",
"message": "The image could not be used: send a JPEG, PNG or WebP image (5 MB and 6000 px per side at most) as a public address, a base64 data URI, or a file sent with POST as multipart/form-data.",
"details": {
"field": "image"
}
}
} Élément bloqué par la modération
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Changer la bannière
PUT/v1/pages/{id}/banner
POST/v1/pages/{id}/banner
image : l'adresse publique d'une image, ou une data URI base64 (data:image/png;base64,…). Pour envoyer un fichier, utilisez POST en multipart/form-data avec un champ image. JPEG, PNG ou WebP, 5 Mo et 6 000 px de côté au plus. Deux formats sont produits, chacun recadrable : crop.classic (1 200 × 630) et crop.wide (1 200 × 400, disposition banner). Refusé si la page suit un style : la bannière est alors celle du style. Selon l'offre. Portée Écriture.
curl -X PUT https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/banner \
-H "Authorization: Bearer tl_votre_jeton" \
-H "Content-Type: application/json" \
-d '{"image":"https://exemple.fr/banniere.jpg"}'
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/banner', {
method: 'PUT',
headers: {
Authorization: 'Bearer tl_votre_jeton',
'Content-Type': 'application/json',
},
body: JSON.stringify({ image: 'https://exemple.fr/banniere.jpg' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/banner');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['image' => 'https://exemple.fr/banniere.jpg']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.put(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/banner',
headers={'Authorization': 'Bearer tl_votre_jeton'},
json={'image': 'https://exemple.fr/banniere.jpg'},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": null,
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "poppinsblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#1E90FF",
"button_title_color": "#FFFFFF",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "circular",
"background_color": "#F3EADF",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": {
"classic": "https://content.tinylink.fr/page-banner/banner_6ad34a102be89.webp",
"wide": "https://content.tinylink.fr/page-banner/wide_banner_6ad34a102be89.webp"
},
"logo": "https://content.tinylink.fr/page-logo/logo_6ad34a0fd937d.webp"
} Le corps n'est pas un objet JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas les bannières
{
"error": {
"code": "plan_feature_unavailable",
"message": "Banners are not included in the plan of this environment's owner."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Écriture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} La page suit un style de page
{
"error": {
"code": "page_style_linked",
"message": "This page follows the page style \"Dark\": its appearance comes from the style. Unlink it first with PATCH /v1/pages/{id}/style and \"style_id\": null, or edit the style."
}
} Image illisible, trop lourde ou d'un format refusé
{
"error": {
"code": "invalid_image",
"message": "The image could not be used: send a JPEG, PNG or WebP image (5 MB and 6000 px per side at most) as a public address, a base64 data URI, or a file sent with POST as multipart/form-data.",
"details": {
"field": "image"
}
}
} Élément bloqué par la modération
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Retirer le logo ou la bannière
DELETE/v1/pages/{id}/logo
DELETE/v1/pages/{id}/banner
Supprime l'image ; la réponse est l'apparence de la page. Rien n'est supprimé d'autre : la portée Écriture suffit.
curl -X DELETE https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo \
-H "Authorization: Bearer tl_votre_jeton"
const response = await fetch('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo', {
method: 'DELETE',
headers: { Authorization: 'Bearer tl_votre_jeton' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.delete(
'https://api.tinylink.fr/v1/pages/P6ad34a0e4fef09/logo',
headers={'Authorization': 'Bearer tl_votre_jeton'},
)
data = response.json()
Réponses possibles
{
"page_id": "P6ad34a0e4fef09",
"style": null,
"settings": {
"header_layout": "classic",
"logo_size": "medium",
"header_text_size": "medium",
"header_color": "#212121",
"header_title_color": "#FFFFFF",
"header_description_color": "#D8D8D8",
"header_icon_color": "#FFFFFF",
"header_title_font": "metroblack",
"header_description_font": "robotoreg",
"button_text_size": "medium",
"button_color": "#FFFFFF",
"button_title_color": "#212121",
"button_description_color": "#888888",
"button_title_font": "robotoreg",
"button_description_font": "robotoreg",
"button_radius": "rounded",
"background_color": "#F0F0F0",
"section_text_size": "medium",
"section_title_color": "#212121",
"section_title_font": "robotobold",
"section_description_color": "#888888",
"section_description_font": "robotoreg"
},
"banner": null,
"logo": null
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Écriture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Aucune page avec cet identifiant ou ce slug dans l'environnement
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} La page suit un style de page
{
"error": {
"code": "page_style_linked",
"message": "This page follows the page style \"Dark\": its appearance comes from the style. Unlink it first with PATCH /v1/pages/{id}/style and \"style_id\": null, or edit the style."
}
} Élément bloqué par la modération
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Lister les polices
GET/v1/fonts
Les polices proposées, par ordre alphabétique : leur id est la valeur des réglages …_font. Portée Lecture.
curl https://api.tinylink.fr/v1/fonts \
-H "Authorization: Bearer tl_votre_jeton"
const response = await fetch('https://api.tinylink.fr/v1/fonts', {
headers: { Authorization: 'Bearer tl_votre_jeton' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/fonts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_votre_jeton'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/fonts',
headers={'Authorization': 'Bearer tl_votre_jeton'},
)
data = response.json()
Réponses possibles
{
"data": [
{
"id": "abrilfat",
"name": "Abril Fatface"
},
{
"id": "bebasneue",
"name": "Bebas Neue"
},
{
"id": "bungee",
"name": "Bungee"
},
{
"id": "caveatreg",
"name": "Caveat Regular"
}
]
} Jeton absent de la requête
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Jeton inconnu ou révoqué
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} L'offre du propriétaire n'inclut pas 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."
}
} Le jeton ne porte pas la portée Lecture
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Plus de 120 requêtes dans la minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
}