code
DveloxSoft Bucket Developer integration guides

Getting Started

Bucket is a file storage service organized around containers. This guide walks you through creating a container, understanding quotas, uploading files, and accessing them via API or code.

Prerequisites

  • Base URL: https://bucket.dveloxsoft.com/api/
  • Authentication: API Key (master or container-scoped).
  • A container slug to target uploads and file operations.

Step 1: Create a container

Containers are the top-level storage unit. Choose a visibility type when creating it:

  • private: only authenticated owners or authorized API keys can access files.
  • public: files can be fetched without authentication via GET /files/:slug/*path.
typescript
const response = await fetch('https://bucket.dveloxsoft.com/api/containers', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'ApiKey <api_key>'
  },
  body: JSON.stringify({
    name: 'my-bucket',
    type: 'private'
  })
});

const container = await response.json();
console.log('Container created:', container.slug);

Step 2: Understand quotas

Each account has a storage limit and a maximum file count. Check usage before bulk operations:

typescript
const response = await fetch('https://bucket.dveloxsoft.com/api/cuota/usage', {
  headers: {
    'Authorization': 'ApiKey <api_key>'
  }
});

const quota = await response.json();
console.log('Storage used:', quota.formattedUsed, 'of', quota.formattedLimit);
console.log('Files count:', quota.fileCountUsed, '/', quota.fileCountLimit);

Step 3: Upload a file

Files under 500 MB can be uploaded in a single request. Larger files use chunked uploads split into 10 MB batches.

typescript
const formData = new FormData();
formData.append('file', fileInput.files[0]);

const response = await fetch(`https://bucket.dveloxsoft.com/api/files/${containerSlug}/path/to/file.txt`, {
  method: 'POST',
  headers: {
    'Authorization': 'ApiKey <api_key>'
  },
  body: formData
});

const result = await response.json();
console.log('Uploaded:', result.path, result.size, 'bytes');

Step 4: Access a file

List directories, download files, or stream them directly. Public containers allow unauthenticated reads.

typescript
// List directory
const list = await fetch(`https://bucket.dveloxsoft.com/api/files/${containerSlug}/path/to/folder`, {
  headers: { 'Authorization': 'Bearer <jwt_token>' }
});
const listing = await list.json();
console.log('Items:', listing.items)

// Download file (browser handles stream)
window.open(`https://bucket.dveloxsoft.com/api/files/${containerSlug}/path/to/file.txt`, '_blank');