Dokumentasi & Panduan API

Integrasikan layanan VyDrive ke dalam aplikasi atau bot kamu dengan mudah.

BASE URL: https://vydrive.zone.id

Upload File

01
POST /upload

Upload file ke VyDrive dan dapatkan link permanen.

Parameter (FormData)

KeyTipeKeterangan
file File / Buffer Konten file wajib — Maks 100MB
expiry String opsional permanent / 1 jam / 24 jam / 7 hari / 30 hari

Contoh Response

{
  "status": 200,
  "method": "POST",
  "url": "https://vydrive.zone.id/f/abcd1234.jpg",
  "directUrl": "https://vydrive.zone.id/f/abcd1234.jpg",
  "success": true
}
02

Contoh Kode (Node.js / WhatsApp Bot)

const axios = require('axios');
const FormData = require('form-data');

async function uploadKeVyDrive(buffer, filename = 'media.jpg') {
  const form = new FormData();
  form.append('file', buffer, filename);
  // Tambah expiry jika perlu:
  // form.append('expiry', '7 hari');

  const res = await axios.post('https://vydrive.zone.id/upload', form, {
    headers: form.getHeaders()
  });
  return res.data.url; // link langsung yang bisa dibagikan
}

Short URL

POST /api/shorten

Buat tautan pendek untuk URL eksternal apapun.

Parameter (JSON Body)

KeyTipeKeterangan
url String URL tujuan wajib
name String Label/nama link opsional
expiry String opsional permanent / 1 jam / 24 jam / 7 hari / 30 hari

Contoh Response

{
  "status": 200,
  "url": "https://vydrive.zone.id/s/xY3kPqRm"
}
// Contoh request (fetch)
const res = await fetch('https://vydrive.zone.id/api/shorten', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://example.com', name: 'My Link', expiry: 'permanent' })
});
const data = await res.json();
console.log(data.url); // => https://vydrive.zone.id/s/xY3kPqRm

File & Metadata

GET /api/files

Ambil daftar file yang telah diupload (terbaru di atas).

Contoh Response

{
  "success": true,
  "count": 5,
  "data": [
    {
      "name": "foto.jpg",
      "shortUrl": "https://vydrive.zone.id/f/abcd1234",
      "downloadUrl": "https://vydrive.zone.id/dl/DriveFileId",
      "timestamp": "2026-04-05T10:00:00.000Z"
    }
  ]
}
GET /api/file/:shortId

Ambil metadata satu file berdasarkan shortId-nya.

Ganti :shortId dengan ID pendek file, contoh: /api/file/abcd1234

Contoh Response

{
  "success": true,
  "data": {
    "name": "foto.jpg",
    "shortUrl": "https://vydrive.zone.id/f/abcd1234",
    "downloadUrl": "https://vydrive.zone.id/dl/DriveFileId",
    "timestamp": "2026-04-05T10:00:00.000Z"
  }
}
Kembali ke Beranda