Developer Documentation
Complete API reference for the GDrive Upload service.
Base URL
https://upload.cobaweb.com
Authentication
All API endpoints require session-based authentication. First, login to get a session cookie.
POST
/api/login
No Auth
Authenticate and receive a session cookie.
Request Body
{
"username": "admin",
"password": "gdrive2026"
}
Response
{
"success": true
}
Returns Set-Cookie: session=<token> header. Include this cookie in all subsequent requests.
Download API
POST
/api/download
Start a background download from URL to Google Drive. Returns immediately with a job ID.
Request Body
{
"url": "https://example.com/file.zip",
"filename": "file.zip", // optional, auto-detected from URL
"folder": "downloads" // optional, subfolder in Google Drive
}
Response
{
"success": true,
"job_id": "a1b2c3d4",
"filename": "file.zip",
"message": "Download started in background"
}
POST
/api/status
Get detailed status of a specific download job.
Request Body
{
"id": "a1b2c3d4"
}
Response
{
"status": "downloading",
"url": "https://example.com/file.zip",
"filename": "file.zip",
"folder": "",
"percent": 45.2,
"downloaded": 47386624,
"total": 104857600,
"speed": 12.5,
"speed_human": "12.5 MB/s",
"downloaded_human": "45.2 MB",
"total_human": "100.0 MB",
"eta_human": "4m 23s",
"elapsed": 3,
"error": "",
"created": 1781474406.32
}
Status Values
| Status | Description |
|---|---|
queued | Waiting to start |
downloading | Currently downloading |
done | Download completed |
error | Download failed |
cancelled | Cancelled by user |
POST
/api/jobs
List all download jobs with optional filtering.
Request Body
{
"filter": "downloading", // optional: "", "downloading", "queued", "done", "error", "cancelled"
"limit": 50 // optional, default 50
}
Response
[
{
"id": "a1b2c3d4",
"status": "downloading",
"filename": "file.zip",
"url": "https://example.com/file.zip",
"folder": "",
"percent": 45.2,
"speed_human": "12.5 MB/s",
"downloaded_human": "45.2 MB",
"total_human": "100.0 MB",
"eta_human": "4m 23s",
"elapsed": 3,
"error": "",
"created": 1781474406.32
}
]
POST
/api/cancel
Cancel an active download.
Request Body
{
"id": "a1b2c3d4"
}
Response
{
"success": true
}
POST
/api/list
List files in Google Drive sync folder.
Request Body
{
"folder": "" // optional, subfolder to list
}
Response
[
{
"name": "file.zip",
"is_dir": false,
"size": 104857600,
"size_human": "100.0 MB",
"modified": "2026-06-14 22:00:00"
}
]
POST
/api/delete
Delete a file from Google Drive sync folder.
Request Body
{
"name": "file.zip",
"folder": "" // optional
}
Response
{
"success": true
}
cURL Examples
Login
curl -c cookies.txt -X POST https://upload.cobaweb.com/api/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"gdrive2026"}'
Start Download
curl -b cookies.txt -X POST https://upload.cobaweb.com/api/download \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/file.zip","filename":"file.zip","folder":"downloads"}'
Check Progress
curl -b cookies.txt -X POST https://upload.cobaweb.com/api/status \
-H "Content-Type: application/json" \
-d '{"id":"a1b2c3d4"}'
Poll Until Done
while true; do
STATUS=$(curl -b cookies.txt -s -X POST https://upload.cobaweb.com/api/status \
-H "Content-Type: application/json" \
-d '{"id":"a1b2c3d4"}' | jq -r '.status')
echo "Status: $STATUS"
[ "$STATUS" = "done" ] && break
[ "$STATUS" = "error" ] && break
sleep 5
done
Integration Examples
Python
import requests
BASE = "https://upload.cobaweb.com"
s = requests.Session()
# Login
s.post(f"{BASE}/api/login", json={"username": "admin", "password": "gdrive2026"})
# Start download
r = s.post(f"{BASE}/api/download", json={
"url": "https://example.com/large-file.zip",
"filename": "large-file.zip",
"folder": "backups"
})
job_id = r.json()["job_id"]
# Poll until done
import time
while True:
status = s.post(f"{BASE}/api/status", json={"id": job_id}).json()
print(f"{status['percent']}% - {status['speed_human']} - ETA {status['eta_human']}")
if status["status"] in ("done", "error"):
break
time.sleep(2)
print("Complete!" if status["status"] == "done" else f"Error: {status['error']}")
JavaScript / Node.js
const BASE = "https://upload.cobaweb.com";
async function downloadFile(url, filename, folder) {
// Login
const loginResp = await fetch(`${BASE}/api/login`, {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify({ username: "admin", password: "gdrive2026" })
});
// Start download
const dlResp = await fetch(`${BASE}/api/download`, {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify({ url, filename, folder })
});
const { job_id } = await dlResp.json();
// Poll
while (true) {
const status = await fetch(`${BASE}/api/status`, {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify({ id: job_id })
}).then(r => r.json());
console.log(`${status.percent}% - ${status.speed_human} - ETA ${status.eta_human}`);
if (["done", "error"].includes(status.status)) break;
await new Promise(r => setTimeout(r, 2000));
}
}
downloadFile("https://example.com/file.zip", "file.zip", "downloads");