MS
MinerSheets by Diofis
Sign In

Access Required

Sign in to access MinerSheets revolutionary features

Sign In Now
Dark Mode
Toggle theme

Access Required

Sign in to access MinerSheets revolutionary features

Sign In Now
Dark Mode
Toggle theme

Access Required

Sign in to access MinerSheets revolutionary features

Sign In Now
Dark Mode
Toggle theme

Access Required

Sign in to access MinerSheets revolutionary features

Sign In Now
Dark Mode
Toggle theme
↑↓ Navigate ↵ Select ESC Close
Powered by Fuse.js

Welcome to MinerSheets

The backbone of operational excellence

Home / Documentation / API Reference

API Reference

Complete RESTful API documentation for MinerSheets integration

🚀 Introduction

The MinerSheets API is a RESTful API that allows you to programmatically interact with your dynamic data models. You can create, read, update, and delete records, as well as search, export, and validate data.

Base URL: http://your-domain.com/api/v1/

🔐 Authentication

MinerSheets API supports two authentication methods:

1. Session Authentication

Use Django session cookies for browser-based applications.

// Login first to get session cookie
fetch('/login/', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: 'username=admin&password=secret'
}).then(() => {
    // Session cookie is now set
    // Make API requests normally
});

2. Token Authentication

Use API tokens for server-to-server or mobile applications.

// Include token in Authorization header
fetch('/api/v1/models/', {
    headers: {
        'Authorization': 'Token your-api-token-here',
        'Content-Type': 'application/json'
    }
});

Note: All API endpoints require authentication. Unauthenticated requests will receive a 401 or 302 response.

📋 Endpoints Overview

Method Endpoint Description
GET /api/v1/models/ List all available models
GET /api/v1/models/{model}/ Get all records from a model
POST /api/v1/models/{model}/records/ Create a new record
PUT /api/v1/models/{model}/records/{id}/ Update an existing record
DELETE /api/v1/models/{model}/records/{id}/delete/ Delete a record
GET /api/v1/models/{model}/search/ Search records with filters
GET /api/v1/models/{model}/export/ Export records (JSON/CSV)
GET /api/v1/schema/{model}/ Get model schema definition
GET /api/v1/choices/{model}/{field}/ Get field choice options
GET

/api/v1/models/

Retrieve a list of all available models in your MinerSheets instance.

Response Example:

{
    "status": "success",
    "models": [
        {
            "name": "Company",
            "verbose_name": "Company Directory",
            "record_count": 42,
            "fields": ["id", "name", "email", "phone"]
        },
        {
            "name": "Employee",
            "verbose_name": "Employees",
            "record_count": 156,
            "fields": ["id", "name", "position", "company"]
        }
    ]
}
GET

/api/v1/models/{model_name}/

Retrieve all records from a specific model with pagination support.

Query Parameters:

page - Page number (default: 1)
page_size - Records per page (default: 50, max: 100)

Request Example:

GET /api/v1/models/Company/?page=1&page_size=20

Response Example:

{
    "status": "success",
    "model": "Company",
    "count": 42,
    "page": 1,
    "page_size": 20,
    "total_pages": 3,
    "records": [
        {
            "id": 1,
            "name": "Diofis Enterprise",
            "email": "info@diofis.net",
            "phone": "+1234567890",
            "created_at": "2025-10-15T10:30:00Z"
        },
        ...
    ]
}
POST

/api/v1/models/{model_name}/records/

Create a new record in the specified model.

Request Body:

{
    "name": "New Company Name",
    "email": "contact@company.com",
    "phone": "+1234567890",
    "website": "https://company.com"
}

Success Response (201 Created):

{
    "status": "success",
    "message": "Record created successfully",
    "record": {
        "id": 43,
        "name": "New Company Name",
        "email": "contact@company.com",
        "phone": "+1234567890",
        "website": "https://company.com",
        "created_at": "2025-10-29T14:30:00Z"
    }
}

Error Response (400 Bad Request):

{
    "status": "error",
    "message": "Validation failed",
    "errors": {
        "email": ["This field is required"],
        "name": ["This field cannot be blank"]
    }
}
PUT

/api/v1/models/{model_name}/records/{id}/

Update an existing record. Only include fields you want to update.

Request Body:

{
    "email": "newemail@company.com",
    "phone": "+9876543210"
}

Success Response (200 OK):

{
    "status": "success",
    "message": "Record updated successfully",
    "record": {
        "id": 43,
        "name": "New Company Name",
        "email": "newemail@company.com",
        "phone": "+9876543210",
        "updated_at": "2025-10-29T15:45:00Z"
    }
}
DELETE

/api/v1/models/{model_name}/records/{id}/delete/

Permanently delete a record. This action cannot be undone.

Success Response (200 OK):

{
    "status": "success",
    "message": "Record deleted successfully"
}

Warning: Deleting records with relationships may affect related data. Check cascade rules before deletion.

GET

/api/v1/models/{model_name}/search/

Search and filter records with advanced query options.

Query Parameters:

q - Search query (searches all text fields)
field_name - Filter by specific field value
field_name__contains - Partial match filter
field_name__gte - Greater than or equal (numbers/dates)
field_name__lte - Less than or equal (numbers/dates)

Request Example:

GET /api/v1/models/Company/search/?q=enterprise&email__contains=@diofis

Response Example:

{
    "status": "success",
    "count": 3,
    "results": [
        {
            "id": 1,
            "name": "Diofis Enterprise",
            "email": "info@diofis.net"
        },
        ...
    ]
}
GET

/api/v1/models/{model_name}/export/

Export records in various formats (JSON, CSV).

Query Parameters:

format - Export format: json, csv (default: json)
fields - Comma-separated list of fields to include

Request Example:

GET /api/v1/models/Company/export/?format=csv&fields=name,email,phone

Response:

Returns file download with appropriate Content-Type header.

JSON: Content-Type: application/json
CSV: Content-Type: text/csv

⚠️ Error Codes

Code Description Common Causes
400 Bad Request Invalid data, validation errors
401 Unauthorized Missing or invalid authentication
403 Forbidden Insufficient permissions
404 Not Found Model or record doesn't exist
500 Internal Server Error Server-side error, contact support

🚦 Rate Limiting

Current Limits: 1000 requests per hour per user

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 1635264000

💻 Code Examples

JavaScript (Fetch API):

// List all models
const models = await fetch('/api/v1/models/', {
    headers: {
        'Authorization': 'Token your-token-here'
    }
}).then(res => res.json());

// Create a new record
const newRecord = await fetch('/api/v1/models/Company/records/', {
    method: 'POST',
    headers: {
        'Authorization': 'Token your-token-here',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        name: 'New Company',
        email: 'info@company.com'
    })
}).then(res => res.json());

Python (Requests):

import requests

BASE_URL = 'http://your-domain.com/api/v1'
headers = {'Authorization': 'Token your-token-here'}

# List all models
response = requests.get(f'{BASE_URL}/models/', headers=headers)
models = response.json()

# Create a new record
data = {'name': 'New Company', 'email': 'info@company.com'}
response = requests.post(
    f'{BASE_URL}/models/Company/records/',
    json=data,
    headers=headers
)
new_record = response.json()

cURL:

# List all models
curl -H "Authorization: Token your-token-here" \
     http://your-domain.com/api/v1/models/

# Create a new record
curl -X POST \
     -H "Authorization: Token your-token-here" \
     -H "Content-Type: application/json" \
     -d '{"name":"New Company","email":"info@company.com"}' \
     http://your-domain.com/api/v1/models/Company/records/

🎯 Next Steps

📚 Getting Started

Quick start guide for developers

🏗️ Architecture

Understand the system design

💬 Need Help?

Contact our support team

MS
MinerSheets

Revolutionary Data Management platform by Diofis Enterprise. Phenomenal artwork in technology that transforms how companies manage data.

Made with ❤️ in Bitung, North Sulawesi, Indonesia by Hendrik Mamarodia.

Quick Links

  • Dashboard
  • All Models
  • Model Factory

Support

  • User Guide
  • API Reference
  • Help Center
  • About Us
  • Site Map
  • Privacy Policy
  • Terms of Service

© 2025 MinerSheets by Diofis Enterprise (Data Infra Ekselen). All rights reserved.

LinkedIn Company Developer Bitung, Indonesia