📚

Dezz Shortlink API Docs

Domain: dezz.web.id

Semua endpoint publik untuk membuat shortlink otomatis, custom, dan contoh integrasi Bot WA.

🚀 Quick Navigation

1️⃣

Auto Shortlink

Membuat shortlink otomatis tanpa custom slug.

Endpoint: /api/create
Method: POST

Request Body:

{
  "original_url": "https://example.com"
}

Response:

{
  "success": true,
  "short_url": "https://dezz.web.id/abc123"
}
2️⃣

Custom Shortlink

Membuat shortlink dengan custom slug sendiri.

Endpoint: /api/customlink
Method: POST

Request Body:

{
  "original_url": "https://example.com",
  "custom_slug": "namalink"
}

Response:

{
  "success": true,
  "short_url": "https://dezz.web.id/namalink"
}
3️⃣

Redirect Shortlink

Redirect otomatis berdasarkan slug

Endpoint: /api/[slug]
Method: GET
Response: Redirect ke URL asli atau 404 jika slug tidak ada.
4️⃣

Contoh Integrasi Bot WA

Bisa langsung membuat shortlink dari chat WhatsApp menggunakan command:

!dezzshort <URL>

Node.js / Baileys:

import axios from "axios";

case 'dezzshort': {
  if (!args[0]) return m.reply('❌ Masukkan URL untuk di-shortlink!');

  const originalUrl = args[0];

  try {
    const res = await axios.post('https://dezz.web.id/api/create', {
      original_url: originalUrl
    });

    if (res.data.success) {
      m.reply(\`✅ Shortlink berhasil dibuat:\n\${res.data.short_url}\`);
    } else {
      m.reply(\`❌ Gagal membuat shortlink: \${res.data.error || 'Unknown error'}\`);
    }
  } catch (err) {
    m.reply(\`❌ Terjadi error: \${err.response?.data?.error || err.message}\`);
  }
}
break;

💡 Note: Pastikan bot sudah memakai axios, Node.js ESM, dan bisa akses internet.

Kembali ke aplikasi: