API Documentation - File Upload Service

This API allows users to upload files from Google Drive to external services using a provided API key.

Endpoint

GET /upload?api=YOUR_API_KEY&drive_id=GOOGLE_DRIVE_FILE_ID

Parameters

Usage

Make a GET request to the endpoint with the required parameters:

GET /upload?api=your_api_key&drive_id=your_drive_file_id

Response

Success Response

On successful upload or if the file already exists:

{
    "status": "success",
    "fileStatus": "NewAdd",
    "name": "file_name.ext",
    "key": "deaddrive_file_uid",
    "driveId": "google_drive_file_id",
    "size": 12345678,
    "download": "/file/unique_file_uid",
    "watch": "/embed/unique_file_uid"
}

Note: If the file already exists, "fileStatus": "AlreadyExist" will be returned and existing links will be used.

Error Response

{
    "status": "error",
    "message": "Error message describing the issue"
}

Possible Error Messages

Example Request

GET /upload?api=abc123&drive_id=1A2B3C4D5E6F7G8H9I0J

Example Success Response

{
    "status": "success",
    "fileStatus": "NewAdd",
    "name": "example.mp4",
    "key": "xyz789",
    "driveId": "1A2B3C4D5E6F7G8H9I0J",
    "size": 104857600,
    "download": "/file/xyz789",
    "watch": "/embed/xyz789"
}

Example Success Response (File Already Exists)

{
    "status": "success",
    "fileStatus": "AlreadyExist",
    "name": "example.mp4",
    "key": "xyz789",
    "driveId": "1A2B3C4D5E6F7G8H9I0J",
    "size": 104857600,
    "download": "/file/xyz789",
    "watch": "/embed/xyz789"
}

Example Error Response

{
    "status": "error",
    "message": "Not a valid Google Drive ID"
}