Developer Documentation

Transform Google Drive links into shareable streaming URLs

โœ… REST API ๐Ÿ”’ Secure โšก Fast

๐Ÿ“‹ Overview

The DOTFLIX API allows you to convert Google Drive video links into shareable streaming URLs. Simply provide your authorization key and a Google Drive URL, and receive a shareable link in return.

โœ… Supported Formats

  • โ€ข MP4 video files
  • โ€ข MKV video files
  • โ€ข Files up to 100GB

๐Ÿ”ง Features

  • โ€ข Instant share link generation
  • โ€ข Real-time processing status
  • โ€ข Download tracking

๐Ÿ” Authentication

All API requests require dual authentication with both an authorization key and an API key. Include both keys in the request body:

{
  "authorization": "your-auth-key-here",
  "apiKey": "your-api-key-here"
}

โš ๏ธ Important: Keep both your authorization key and API key secure and never expose them in client-side code. Both keys are required for all API requests.

๐ŸŒ API Endpoints

POST /api/create-share
Create sharing link

Convert a Google Drive URL into a shareable streaming link

GET /api/share-status/:code
Check status

Get the current status and details of a sharing link

GET /api/sharing-status
System status

Check if the sharing service is currently available

โž• Create Share Link

POST /api/create-share

Request Body

{
  "authorization": "your-auth-key",
  "apiKey": "your-api-key",
  "driveUrl": "https://drive.google.com/file/d/1BxiMVs0XRA5nFMRX-nheFMQRHjb_FLyzB/view"
}

Parameters

Parameter Type Required Description
authorization string Yes Your API authorization key
apiKey string Yes Your API key (second authentication layer)
driveUrl string Yes Google Drive file URL (MP4/MKV only)

Success Response

200 OK
{
  "success": true,
  "shareLink": "https://your-domain.com/share/ABC12345",
  "sharingCode": "ABC12345",
  "filename": "movie.mp4",
  "fileType": "mp4"
}

Error Responses

400 Bad Request Missing required fields
{
  "success": false,
  "error": "Authorization key is required"
}
401 Unauthorized Invalid authorization
{
  "success": false,
  "error": "Invalid authorization key"
}

๐Ÿ“Š Check Share Status

GET /api/share-status/:code

URL Parameters

Parameter Type Description
code string The sharing code returned from create-share

Success Response

200 OK
{
  "success": true,
  "sharingCode": "ABC12345",
  "filename": "movie.mp4",
  "fileType": "mp4",
  "status": "completed",
  "downloadCount": 5,
  "createdAt": "2024-01-01T12:00:00.000Z",
  "updatedAt": "2024-01-01T12:05:00.000Z",
  "shareLink": "https://your-domain.com/share/ABC12345"
}

Status Values

pending

Request received, processing not started

processing

Currently being processed

completed

Ready for download

failed

Processing failed

๐Ÿ’ป Code Examples

๐ŸŸจ JavaScript / Node.js

// Create share link
async function createShareLink(authKey, apiKey, driveUrl) {
    const response = await fetch('https://your-domain.com/api/create-share', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            authorization: authKey,
            apiKey: apiKey,
            driveUrl: driveUrl
        })
    });
    
    const data = await response.json();
    
    if (data.success) {
        console.log('Share link created:', data.shareLink);
        return data;
    } else {
        console.error('Error:', data.error);
        throw new Error(data.error);
    }
}

// Check status
async function checkStatus(sharingCode) {
    const response = await fetch(`https://your-domain.com/api/share-status/${sharingCode}`);
    const data = await response.json();
    
    if (data.success) {
        console.log('Status:', data.status);
        return data;
    } else {
        console.error('Error:', data.error);
        throw new Error(data.error);
    }
}

// Usage
const authKey = 'your-auth-key';
const apiKey = 'your-api-key';
const driveUrl = 'https://drive.google.com/file/d/1BxiMVs0XRA5nFMRX-nheFMQRHjb_FLyzB/view';

createShareLink(authKey, apiKey, driveUrl)
    .then(result => {
        console.log('Created:', result.shareLink);
        return checkStatus(result.sharingCode);
    })
    .then(status => {
        console.log('Current status:', status.status);
    })
    .catch(error => {
        console.error('Error:', error.message);
    });

๐Ÿ Python

import requests
import json

class DotflixAPI:
    def __init__(self, base_url, auth_key, api_key):
        self.base_url = base_url
        self.auth_key = auth_key
        self.api_key = api_key
    
    def create_share_link(self, drive_url):
        """Create a new share link"""
        url = f"{self.base_url}/api/create-share"
        payload = {
            "authorization": self.auth_key,
            "apiKey": self.api_key,
            "driveUrl": drive_url
        }
        
        response = requests.post(url, json=payload)
        data = response.json()
        
        if data.get('success'):
            return data
        else:
            raise Exception(f"API Error: {data.get('error')}")
    
    def check_status(self, sharing_code):
        """Check the status of a share link"""
        url = f"{self.base_url}/api/share-status/{sharing_code}"
        
        response = requests.get(url)
        data = response.json()
        
        if data.get('success'):
            return data
        else:
            raise Exception(f"API Error: {data.get('error')}")

# Usage
api = DotflixAPI('https://your-domain.com', 'your-auth-key', 'your-api-key')

try:
    # Create share link
    drive_url = 'https://drive.google.com/file/d/1BxiMVs0XRA5nFMRX-nheFMQRHjb_FLyzB/view'
    result = api.create_share_link(drive_url)
    
    print(f"Share link created: {result['shareLink']}")
    print(f"Sharing code: {result['sharingCode']}")
    
    # Check status
    status = api.check_status(result['sharingCode'])
    print(f"Current status: {status['status']}")
    
except Exception as e:
    print(f"Error: {e}")

๐ŸŒ cURL

# Create share link
curl -X POST https://your-domain.com/api/create-share \
  -H "Content-Type: application/json" \
  -d '{
    "authorization": "your-auth-key",
    "apiKey": "your-api-key",
    "driveUrl": "https://drive.google.com/file/d/1BxiMVs0XRA5nFMRX-nheFMQRHjb_FLyzB/view"
  }'

# Check status (replace ABC12345 with actual sharing code)
curl https://your-domain.com/api/share-status/ABC12345

โš ๏ธ Error Codes

Status Code Error Description Solution
400 Authorization key is required Missing authorization in request Include authorization key in request body
400 API key is required Missing apiKey in request Include API key in request body
400 Drive URL is required Missing driveUrl in request Include valid Google Drive URL
401 Invalid authorization key Authorization key not recognized Check your authorization key
401 Invalid API key API key not recognized Check your API key
400 Invalid Google Drive URL format URL doesn't match Drive patterns Use valid Google Drive file URL
400 Only MP4 and MKV files are supported File type not supported Use MP4 or MKV video files only
404 Share link not found Sharing code doesn't exist Check the sharing code
500 Internal server error Server-side error occurred Try again later or contact support
503 Service temporarily unavailable Sharing disabled for maintenance Wait for maintenance to complete

๐Ÿงช Testing with Postman

Quick Test Setup

  1. Open Postman and create a new request
  2. Set method to POST
  3. Enter URL: https://your-domain.com/api/create-share
  4. Set header: Content-Type: application/json
  5. Add the JSON body with your auth key and drive URL
  6. Send the request and check the response

Test Collection

Download our Postman collection for comprehensive API testing:

Need help? Contact our support team or check the main website

ยฉ 2024 DOTFLIX โ€ข API v1.0 โ€ข Last updated: January 2024