Exemple de démarrage rapide
// Shorten URL with Trimlink API
const response = await fetch('https://trimlink.ai/api/1.0/short-urls', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Landing page testing",
"domain": "trimlink.ai",
"original_url": "https://your-long-url.com",
"alias": "91xYa", // Optional
"tags": "Test,Trim Link", // Optional
"is_expire_enabled": true, // Default False
"expire_at": "2025-05-31T19:32",
"is_gps_tracking_enabled": true, // Default False
"is_protected": true, // Default False
"password": "Abcd@123",
})
});
const result = await response.json();
console.log('Short URL:', result.short_url);