Endpoint
API Upload File
Upload file dan dapatkan link yang bisa dibagikan secara instan
Autentikasi Diperlukan
Semua endpoint upload memerlukan autentikasi. Anda dapat login via web atau menggunakan API key.
Login Web
Login melalui dashboard untuk menggunakan session cookies
POST /api/upload/file
Upload file via multipart/form-data
Detail Request
POST
/api/upload/fileContent-Type:multipart/form-data
Autentikasi:Required
Header:X-API-Key
Field Wajib:file
Field Opsional:uploader_name
Batas Rate
Limit per API Key:20 / day
Ukuran file maksimal:50 MB
Max API Keys:3 per user
Contoh Kode
curl
# Dengan API Key
curl -X POST "http://upload.yilzicode.com/api/upload/file" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Accept: application/json" \
-F "file=@./path/to/your/file.jpg" \
-F "uploader_name=John Doe"Response Sukses
HTTP 200Sukses
{
"id": "abc123def456",
"name": "file.jpg",
"download_link": "http://upload.yilzicode.com/api/d/abc123def456",
"share_link": "http://upload.yilzicode.com/download/d/abc123def456"
}Field Response
id- Identifier file unikname- Nama file aslidownload_link- URL download langsungshare_link- URL halaman berbagi
Pola URL
/api/d/{id}- Download langsung/download/d/{id}- Halaman berbagi/api/getfile/{id}- Redirect API
Response Error
HTTP 401Autentikasi Diperlukan
{
"ok": false,
"message": "Authentication required. Please log in or provide an API key via X-API-Key header.",
"code": "AUTH_REQUIRED",
"docs": "http://upload.yilzicode.com/docs"
}HTTP 401API key tidak valid
{
"ok": false,
"message": "Invalid API key",
"code": "INVALID_API_KEY"
}HTTP 401Error autentikasi API key
{
"ok": false,
"message": "API key usage limit reached",
"code": "API_KEY_ERROR"
}HTTP 400Field file tidak ada
{
"message": "file is required"
}HTTP 429Batas rate terlampaui
{
"message": "Rate limit exceeded",
"used": 20,
"remaining": 0,
"limit": 20
}HTTP 403IP diblokir
{
"message": "IP blocked"
}HTTP 413File terlalu besar
{
"message": "File too large for Redis storage (max 10MB)",
"code": "STORAGE_LIMIT_EXCEEDED"
}