Introduction

The AdultDataLink Storage and Database API provides robust solutions for managing files and structured data tailored for the adult industry. Designed for developers, content managers, and platform operators, these services enable secure file storage, efficient database operations, and seamless content delivery through a Content Delivery Network (CDN). Whether you're building a content management system, analytics platform, or integrating with adult content platforms like Pornhub, XNXX, or RedGIFs, AdultDataLink offers scalable and secure tools to streamline your workflows.

Key features include:

This documentation guides you through integrating with the Storage and Database APIs, securing your requests, and leveraging features to build powerful adult industry applications. For commercial access or custom solutions, contact our support team at adultdatalink.com/contact.

This is the API documentation for the storage services. To use your storage dashboard please visit storage.adultdatalink.com.

Authentication

All requests to the AdultDataLink Storage and Database APIs require authentication via an API key, ensuring secure access to your resources.

Step 1: Create an Account

Register at account.adultdatalink.com. Verify your email to access your dashboard.

Step 2: Generate an API Key

In your dashboard, navigate to the API Keys section and click Create API Key. Name your key and set permissions. Copy and store the key securely, as it will be shown only once.

Step 3: Use Your API Key

Include your API key in the Authorization header for all requests:

GET /storage/user-storage-info HTTP/1.1
Host: api.adultdatalink.com
Authorization: Bearer YOUR_API_KEY_HERE
        

Security Best Practices

  • Use HTTPS to encrypt API calls.
  • Keep API keys confidential, avoiding exposure in frontend code or public repositories.
  • Rotate keys regularly via the dashboard.
  • Store keys in environment variables or secure vaults in production.

If your key is compromised, revoke it in the dashboard and generate a new one immediately.

Storage Service

The Storage Service allows you to upload, manage, and retrieve files securely, with support for folder organization and storage usage tracking. It integrates with a CDN for low-latency content delivery, ideal for media-heavy adult industry applications.

Key Features

  • File Upload/Download: Upload files to user-specific folders and download them via secure endpoints.
  • Folder Management: Create, rename, and delete folders to organize content.
  • Storage Quotas: Monitor storage usage with a default limit (e.g., 1024 MB), adjustable per user.
  • Upload URLs: Generate secure, temporary URLs for programmatic file uploads without direct authentication.
  • File Viewing: Preview supported file types (e.g., images, videos, text, JSON) in the browser.

Frontend Integration

The Storage Service includes a user-friendly interface for managing files and folders. Below is an example of uploading a file using the provided JavaScript:

const formData = new FormData();
formData.append('file', document.getElementById('fileInput').files[0]);
fetch(`${getBaseUrl()}/storage/upload?folder=my_folder`, {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${getApiKey()}`
    },
    body: formData
})
.then(response => response.json())
.then(result => console.log(result.message))
.catch(error => console.error('Error:', error));
        

The interface displays storage usage, lists files and folders, and provides actions like download, view, delete, and generate upload URLs. Tooltips and modals enhance user interaction, as seen in the storage.js file.

Example: Creating an Upload URL

Generate a secure upload URL for a folder:

fetch(`${getBaseUrl()}/storage/create-upload-url`, {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${getApiKey()}`,
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ folder_name: 'my_folder' })
})
.then(response => response.json())
.then(result => console.log(result.upload_url))
.catch(error => console.error('Error:', error));
        

Use the returned URL to upload files without authentication, ideal for third-party integrations.

Database Service

The Database Service enables the creation and management of custom databases with flexible column definitions (string, integer, boolean). It supports record creation, retrieval, updates, and deletion, with API endpoints for programmatic access.

Key Features

  • Database Creation: Define databases with custom columns for structured data storage.
  • Record Management: Add, update, and delete records with validation against column types.
  • API Endpoints: Generate secure endpoints for creating records programmatically.
  • Usage Tracking: Monitor successful and failed API calls via user storage metadata.

Frontend Integration

The database interface allows users to create databases, define columns, and manage records. Below is an example of creating a database:

fetch(`${getBaseUrl()}/database/create`, {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${getApiKey()}`,
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        name: 'content_metadata',
        columns: [
            { name: 'title', type: 'string' },
            { name: 'views', type: 'int' },
            { name: 'is_active', type: 'bool' }
        ]
    })
})
.then(response => response.json())
.then(result => console.log(result.message))
.catch(error => console.error('Error:', error));
        

The interface displays databases with their columns and creation dates, offering actions like viewing records, generating API endpoints, and deleting databases. Modals provide feedback for actions like endpoint generation.

Example: Creating a Record via Endpoint

Use a generated API endpoint to create a record:

fetch('https://api.adultdatalink.com/database/api/ENDPOINT_KEY/records', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        data: { title: 'Sample Video', views: 1000, is_active: true }
    })
})
.then(response => response.json())
.then(result => console.log(result.message))
.catch(error => console.error('Error:', error));
        

API Endpoints

The Storage and Database APIs provide RESTful endpoints for programmatic access. Refer to the Swagger UI below for detailed endpoint specifications, including request/response formats and parameters.