### Get User Folders (Python) Source: https://docs.drime.cloud/api-reference/files/get-user-folders This Python example shows how to retrieve user folders using the requests library. Remember to substitute YOUR_ACCESS_TOKEN with your authentication token. ```python import requests user_id = 15843 response = requests.get( f'https://app.drime.cloud/api/v1/users/{user_id}/folders', params={'workspaceId': 0}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) data = response.json() folders = data['folders'] root = data['rootFolder'] ``` -------------------------------- ### Successful Response Example Source: https://docs.drime.cloud/api-reference/files/get-folder-path This is an example of a successful response from the Get Folder Path API, showing the structure of the returned path array and the status. ```json { "path": [ { "id": 111344, "name": "Documents", "type": "folder", "path": "111344", "hash": "MTExMzQ0fHBhZA" }, { "id": 111345, "name": "Projects", "type": "folder", "path": "111344/111345", "hash": "MTExMzQ1fHBhZA" }, { "id": 111346, "name": "2024", "type": "folder", "path": "111344/111345/111346", "hash": "MTExMzQ2fHBhZA" } ], "status": "success" } ``` -------------------------------- ### Example Response: No Parts Yet Source: https://docs.drime.cloud/api-reference/multipart/get-uploaded-parts This is an example of a successful response when no parts have been uploaded yet for a multipart upload. The 'parts' array is empty. ```json { "parts": [], "status": "success" } ``` -------------------------------- ### API Response Examples Source: https://docs.drime.cloud/api-reference/notes/create-note Examples of successful creation response and a validation error response when creating a note. ```json { "status": "success", "note": { "id": 3, "title": "My New Note", "body": "This is the content of my note...", "created_at": "2024-01-20T10:00:00.000000Z", "updated_at": "2024-01-20T10:00:00.000000Z" } } ``` ```json { "status": "error", "message": "The given data was invalid.", "errors": { "title": "The title field is required." } } ``` -------------------------------- ### Get Logged User with Python Source: https://docs.drime.cloud/api-reference/user/get-logged-user This Python example shows how to retrieve the logged-in user's information using the requests library. It highlights the necessary Authorization header. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/cli/loggedUser', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) print(response.json()) ``` -------------------------------- ### Sample Success Response for Get Notes Source: https://docs.drime.cloud/api-reference/notes/get-notes This is an example of a successful response when retrieving all notes. It returns an array of note objects, each with an ID, title, body, and timestamps. ```json [ { "id": 1, "title": "Meeting Notes", "body": "Discussed project timeline and deliverables...", "created_at": "2024-01-15T10:30:00.000000Z", "updated_at": "2024-01-15T14:20:00.000000Z" }, { "id": 2, "title": "Ideas", "body": "Feature ideas for the next release...", "created_at": "2024-01-16T09:00:00.000000Z", "updated_at": "2024-01-16T09:00:00.000000Z" } ] ``` -------------------------------- ### Example Response: Parts Uploaded Source: https://docs.drime.cloud/api-reference/multipart/get-uploaded-parts This is an example of a successful response when some parts of a multipart upload have already been uploaded. It includes the PartNumber, ETag, and Size for each uploaded part. ```json { "parts": [ { "PartNumber": 1, "ETag": "\"22b1d5721320f9da081e4987f0e0ce65\"", "Size": 5242880 }, { "PartNumber": 2, "ETag": "\"479df46a73824ca1a5e44efe64d3dbb7\"", "Size": 1405792 } ], "status": "success" } ``` -------------------------------- ### API Response Example Source: https://docs.drime.cloud/api-reference/tracking/set-tracked This is an example of a successful response when setting the tracked status for a file. It indicates whether the update operation was successful. ```json { "updated": true, "status": "success" } ``` -------------------------------- ### Get File Entry with JavaScript Source: https://docs.drime.cloud/api-reference/files/get-file-entry Fetch file entry details using JavaScript's fetch API. This example demonstrates how to construct the request and parse the JSON response. ```javascript const entryId = 485529678; const response = await fetch( `https://app.drime.cloud/api/v1/file-entries/${entryId}`, { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } } ); const { fileEntry } = await response.json(); ``` -------------------------------- ### Successful Response Example Source: https://docs.drime.cloud/api-reference/user/get-logged-user This is an example of a successful JSON response when retrieving the logged-in user's information. It includes user details like ID, email, and name. ```json { "user": { "id": 15843, "email": "user@example.com", "display_name": "John Doe", "first_name": "John", "last_name": "Doe", "created_at": "2024-01-01T00:00:00.000000Z", "updated_at": "2024-01-15T10:30:00.000000Z" } } ``` -------------------------------- ### Get Presigned URL and Upload File (cURL) Source: https://docs.drime.cloud/api-reference/uploads/presign-url Use this cURL example to first obtain a presigned URL for direct S3 upload and then to perform the PUT request with your file data. Ensure you replace placeholders with your actual token and file details. ```bash # Step 1: Get presigned URL curl -X POST https://app.drime.cloud/api/v1/s3/simple/presign \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filename": "document.pdf", "mime": "application/pdf", "size": 87965, "extension": "pdf", "workspaceId": 0 }' # Step 2: Upload to presigned URL curl -X PUT "PRESIGNED_URL" \ -H "Content-Type: application/pdf" \ --data-binary @document.pdf ``` -------------------------------- ### Get Folder Path using Python Source: https://docs.drime.cloud/api-reference/files/get-folder-path This Python example shows how to retrieve the folder path using the requests library and then format it into a breadcrumb string. It requires the folder hash and an authorization token. ```python import requests folder_hash = 'MTExMzQ0fHBhZA' response = requests.get( f'https://app.drime.cloud/api/v1/folders/{folder_hash}/path', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) path = response.json()['path'] breadcrumb = ' / '.join(f['name'] for f in path) print(breadcrumb) ``` -------------------------------- ### Get Vault Information (Python) Source: https://docs.drime.cloud/api-reference/vault/get-vault This Python example uses the requests library to retrieve vault information. It sends the access token in the Authorization header and prints the Vault ID. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/vault', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) vault = response.json()['vault'] print(f"Vault ID: {vault['id']}") ``` -------------------------------- ### Example Success Response for Workspace Roles Source: https://docs.drime.cloud/api-reference/user/get-workspace-roles This is an example of a successful response when fetching workspace roles. It includes pagination details and a list of role objects, each with an ID, name, description, and type. ```json { "pagination": { "data": [ { "id": 1, "name": "Workspace Viewer", "description": "Can view files and folders", "type": "workspace" }, { "id": 2, "name": "Workspace Editor", "description": "Can view, create, and edit files", "type": "workspace" }, { "id": 3, "name": "Workspace Owner", "description": "Full access to workspace", "type": "workspace" } ], "current_page": 1, "last_page": 1, "per_page": 15, "total": 3 }, "status": "success" } ``` -------------------------------- ### POST /api/v1/vault/create Source: https://docs.drime.cloud/api-reference/vault/create-vault Initializes the user's encrypted vault. This is a one-time setup operation. ```APIDOC ## POST /api/v1/vault/create ### Description Creates and initializes the user's encrypted vault. This is a one-time setup operation. ### Method POST ### Endpoint https://app.drime.cloud/api/v1/vault/create ### Parameters #### Request Body - **password** (string) - Required - Vault password/passphrase for encryption ### Request Example ```bash cURL curl -X POST https://app.drime.cloud/api/v1/vault/create \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "password": "your-secure-vault-password" }' ``` ```javascript const response = await fetch('https://app.drime.cloud/api/v1/vault/create', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ password: 'your-secure-vault-password' }) }); const { vault } = await response.json(); console.log('Vault created:', vault.id); ``` ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/vault/create', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={'password': 'your-secure-vault-password'} ) vault = response.json()['vault'] print(f'Vault created: {vault["id"]}') ``` ### Response #### Success Response (200) - **vault** (object) - The created vault object - **status** (string) - Request status (`success`) #### Response Example ```json { "status": "success", "vault": { "id": 993, "user_id": 15843, "salt": "aqtS3SdP/4pgWlGsDewDMw==", "check": "YYx1WHsVEwqROOwEzgnXU7fkoyCTVASPkVpVkg==", "iv": "VE/FW/XvPwQ2fTB5", "created_at": "2025-12-18T16:09:13.000000Z" } } ``` ### Warning **Store your vault password securely!** There is no way to recover encrypted files if you forget the password. ``` -------------------------------- ### Resource Not Found (404) Format Source: https://docs.drime.cloud/errors Example JSON response when a requested resource is not found. ```json { "message": "No query results for model [App\FileEntry] 123456" } ``` -------------------------------- ### Get Workspace File Stats using Python Source: https://docs.drime.cloud/api-reference/user/get-workspace-files This Python example uses the requests library to query the API for workspace file statistics. It then prints the number of files and their total size, converted to megabytes. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/workspace_files', params={'workspaceId': 0}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) data = response.json() print(f"{data['files']} files, {data['size'] / 1024 / 1024:.2f} MB total") ``` -------------------------------- ### API Response Example (Success with no backups) Source: https://docs.drime.cloud/api-reference/files/get-file-backup This JSON structure indicates a successful request where no backup versions were found for the specified file. ```json { "pagination": { "current_page": 1, "data": [], "total": 0, "per_page": 15 }, "status": "success" } ``` -------------------------------- ### Vault Entry Response Example Source: https://docs.drime.cloud/api-reference/vault/get-vault-entries This is an example of a successful response when fetching vault entries. It includes pagination details and an array of file entry objects, each containing metadata like `id`, `name`, `file_size`, and encryption information (`is_encrypted`, `iv`). ```json { "pagination": { "current_page": 1, "data": [ { "id": 111345, "name": "confidential.pdf", "type": "file", "file_size": 371266, "is_encrypted": 1, "iv": "JLo1M0ZrXoB/M5io", "vault_id": 993, "hash": "MTExMzQ1fHBhZA" } ], "last_page": 1, "total": 1 }, "status": "success", "seo": null } ``` -------------------------------- ### API Response Example (Success with backups) Source: https://docs.drime.cloud/api-reference/files/get-file-backup This JSON structure represents a successful response when backup versions are available for the requested file. ```json { "pagination": { "current_page": 1, "data": [ { "id": 456, "name": "document_backup_20240115.pdf", "file_size": 1048576, "created_at": "2024-01-15T10:30:00.000000Z" } ], "total": 1, "per_page": 15 }, "status": "success" } ``` -------------------------------- ### Get Workspace Details (Python) Source: https://docs.drime.cloud/api-reference/user/get-workspace This Python script uses the 'requests' library to get workspace information. Remember to substitute 'YOUR_ACCESS_TOKEN' with your authentication token. ```python import requests workspace_id = 1873 response = requests.get( f'https://app.drime.cloud/api/v1/workspace/{workspace_id}', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) workspace = response.json()['workspace'] ``` -------------------------------- ### API Response: Success Source: https://docs.drime.cloud/api-reference/files/create-folder This is an example of a successful response when creating a folder. It includes the status and details of the newly created folder object. ```json { "status": "success", "folder": { "id": 485529680, "name": "My New Folder", "type": "folder", "hash": "NDg1NTI5NjgwfA", "file_size": 0, "parent_id": null, "workspace_id": 0, "path": "485529680", "created_at": "2024-01-20T10:00:00.000000Z", "updated_at": "2024-01-20T10:00:00.000000Z" } } ``` -------------------------------- ### Authentication Header Example Source: https://docs.drime.cloud/api-reference/introduction All requests require a Bearer token in the Authorization header. Replace YOUR_ACCESS_TOKEN with your actual token. ```bash Authorization: Bearer YOUR_ACCESS_TOKEN ``` -------------------------------- ### Sample Workspace Response Source: https://docs.drime.cloud/api-reference/user/get-workspace This is an example of a successful JSON response when retrieving workspace details. It includes workspace information and the request status. ```json { "workspace": { "id": 1873, "name": "My Workspace", "avatar": "https://www.gravatar.com/avatar/", "owner_id": 15843, "created_at": "2025-12-18T18:39:07.000000Z", "updated_at": "2025-12-18T18:39:07.000000Z", "members_count": 3, "currentUser": { "role_name": "Workspace Owner", "email": "user@example.com", "role_id": 3, "is_owner": true } }, "status": "success" } ``` -------------------------------- ### Successful Workspace Creation Response Source: https://docs.drime.cloud/api-reference/user/create-workspace This is an example of a successful response when creating a workspace. It includes details about the workspace and the status. ```json { "workspace": { "owner_id": 15843, "name": "My New Workspace", "updated_at": "2025-12-18T18:39:45.000000Z", "created_at": "2025-12-18T18:39:45.000000Z", "id": 1874, "members_count": 1, "currentUser": { "role_name": "Workspace Owner", "email": "user@example.com", "workspace_id": 1874, "role_id": 3, "is_owner": true }, "owner": { "role_name": "Workspace Owner", "email": "user@example.com", "is_owner": true } }, "status": "success" } ``` -------------------------------- ### Successful Registration Response Source: https://docs.drime.cloud/api-reference/auth/register This is an example of a successful response when a new user account is created. It includes the user's details and an access token. ```json { "status": "success", "user": { "id": 15844, "email": "newuser@example.com", "display_name": "newuser", "access_token": "124|xyz789...", "created_at": "2024-01-20T10:00:00.000000Z", "updated_at": "2024-01-20T10:00:00.000000Z" } } ``` -------------------------------- ### Sign and Upload Parts using JavaScript Source: https://docs.drime.cloud/api-reference/multipart/sign-part-urls This JavaScript example demonstrates how to calculate the total number of parts, request presigned URLs for all parts, and then upload each part concurrently. It also shows how to retrieve the ETag for each uploaded part, which is necessary for completing the upload. ```javascript const PART_SIZE = 5 * 1024 * 1024; // 5MB const totalParts = Math.ceil(file.size / PART_SIZE); // Get URLs for all parts const response = await fetch('https://app.drime.cloud/api/v1/s3/multipart/batch-sign-part-urls', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ key, uploadId, partNumbers: Array.from({ length: totalParts }, (_, i) => i + 1) }) }); const { urls } = await response.json(); // Upload each part const uploadedParts = []; for (const { partNumber, url } of urls) { const start = (partNumber - 1) * PART_SIZE; const end = Math.min(start + PART_SIZE, file.size); const chunk = file.slice(start, end); const uploadResponse = await fetch(url, { method: 'PUT', body: chunk }); const etag = uploadResponse.headers.get('ETag'); uploadedParts.push({ PartNumber: partNumber, ETag: etag }); } ``` -------------------------------- ### Get File Backup History (Python) Source: https://docs.drime.cloud/api-reference/files/get-file-backup This Python script uses the requests library to get the file backup history. Ensure you have the 'requests' library installed and replace 'YOUR_ACCESS_TOKEN' with your credentials. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/file-backup', params={'file_id': 123, 'workspaceId': 0}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) backups = response.json()['pagination']['data'] ``` -------------------------------- ### Register User with Python Source: https://docs.drime.cloud/api-reference/auth/register This Python example shows how to register a new user using the requests library. It sends a POST request with a JSON payload. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/auth/register', json={ 'email': 'newuser@example.com', 'password': 'securepassword123', 'device_name': 'My App' } ) data = response.json() ``` -------------------------------- ### Create Folder using JavaScript Source: https://docs.drime.cloud/api-reference/files/create-folder This JavaScript example demonstrates how to create a folder using the Fetch API. It includes setting the necessary headers and request body. The `parentId` can be set to `null` for the root directory or a specific folder ID. ```javascript const response = await fetch( 'https://app.drime.cloud/api/v1/folders?workspaceId=0', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'My New Folder', parentId: null // null = root, or specify folder ID }) } ); const { folder } = await response.json(); console.log(`Created folder: ${folder.name} (ID: ${folder.id})`); ``` -------------------------------- ### POST /api/v1/s3/simple/presign Source: https://docs.drime.cloud/api-reference/uploads/presign-url Gets a presigned URL for uploading files smaller than 5MB directly to S3/R2 storage. The URL is valid for 1 hour. ```APIDOC ## POST /api/v1/s3/simple/presign ### Description Gets a presigned URL for uploading files smaller than 5MB directly to S3/R2 storage. This is more efficient than the direct upload endpoint. ### Method POST ### Endpoint https://app.drime.cloud/api/v1/s3/simple/presign ### Parameters #### Request Body - **filename** (string) - Required - Original filename - **mime** (string) - Required - MIME type of the file - **size** (integer) - Required - File size in bytes - **extension** (string) - Required - File extension without dot - **workspaceId** (integer) - Optional - Workspace ID. Use `0` for personal workspace. - **relativePath** (string) - Optional - Folder path for auto-creation - **parentId** (integer) - Optional - Parent folder ID ### Request Example ```json { "filename": "document.pdf", "mime": "application/pdf", "size": 87965, "extension": "pdf", "workspaceId": 0 } ``` ### Response #### Success Response (200) - **url** (string) - Presigned URL for PUT upload (valid for 1 hour) - **key** (string) - S3 key (format: `uploads/{uuid}/{uuid}`) - **acl** (string) - Access control (`private`) - **status** (string) - Request status (`success`) #### Response Example ```json { "url": "https://drimestorage.xxx.r2.cloudflarestorage.com/uploads/71ea55f2.../71ea55f2...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...", "key": "uploads/71ea55f2-1ba7-46ad-98b7-db487ecac2f6/71ea55f2-1ba7-46ad-98b7-db487ecac2f6", "acl": "private", "status": "success" } ``` ``` -------------------------------- ### Fetch All Notes (Python) Source: https://docs.drime.cloud/api-reference/notes/get-notes This Python example uses the requests library to retrieve all notes. It shows how to set the Authorization header and print the count of retrieved notes. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/notes', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) notes = response.json() print(f'Found {len(notes)} notes') ``` -------------------------------- ### Star Multiple File Entries with Python Source: https://docs.drime.cloud/api-reference/starring/star-entries This Python example shows how to star file entries using the requests library. Replace YOUR_ACCESS_TOKEN with your valid token. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/file-entries/star', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={'entryIds': [123456, 789012]} ) print('Entries starred') ``` -------------------------------- ### Get File Backup History (cURL) Source: https://docs.drime.cloud/api-reference/files/get-file-backup Use this cURL command to fetch the backup history for a file. Replace 'YOUR_ACCESS_TOKEN' with your actual token. ```bash curl "https://app.drime.cloud/api/v1/file-backup?file_id=123&workspaceId=0" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Create Vault using Python Source: https://docs.drime.cloud/api-reference/vault/create-vault This Python example shows how to create a vault using the requests library. It includes setting the Authorization header and sending the password in the JSON body. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/vault/create', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={'password': 'your-secure-vault-password'} ) vault = response.json()['vault'] print(f'Vault created: {vault["id"]}') ``` -------------------------------- ### List File Tags with Search Query (Python) Source: https://docs.drime.cloud/api-reference/files/get-file-tags This Python example shows how to retrieve file tags using the requests library, applying a search query for filtering. Remember to substitute YOUR_ACCESS_TOKEN with your authentication token. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/file-entry-tags', params={'query': 'project'}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) tags = response.json()['tags'] ``` -------------------------------- ### Example Request with Workspace Context Source: https://docs.drime.cloud/api-reference/introduction Many endpoints accept a workspaceId parameter. Use '0' for your personal workspace or a specific ID for team workspaces. ```bash GET /drive/file-entries?workspaceId=0 ``` -------------------------------- ### Get a Note by ID using Python Source: https://docs.drime.cloud/api-reference/notes/get-note This Python example shows how to retrieve a note using the `requests` library. Substitute 'YOUR_ACCESS_TOKEN' with your token and '1' with the note's ID. The output will display the note's title. ```python import requests note_id = 1 response = requests.get( f'https://app.drime.cloud/api/v1/getNote/{note_id}', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) note = response.json()['data'] print(f"Note: {note['title']}") ``` -------------------------------- ### Enable Tracking for a File (Python) Source: https://docs.drime.cloud/api-reference/tracking/set-tracked This Python example uses the requests library to enable file tracking. It sends a POST request with the necessary authentication and JSON payload. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/track/setTracked', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={ 'file_id': 487159699, 'tracked': True } ) print(f"Tracking enabled: {response.json()['updated']}") ``` -------------------------------- ### Make First API Request (cURL) Source: https://docs.drime.cloud/quickstart Make your first API request by including your access token in the Authorization header. ```bash curl https://app.drime.cloud/api/v1/cli/loggedUser \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Vault Information (cURL) Source: https://docs.drime.cloud/api-reference/vault/get-vault Use this cURL command to make a GET request to the vault API endpoint. Ensure you replace 'YOUR_ACCESS_TOKEN' with your actual access token. ```bash curl -X GET https://app.drime.cloud/api/v1/vault \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Create Workspace using JavaScript Source: https://docs.drime.cloud/api-reference/user/create-workspace This JavaScript snippet demonstrates how to create a workspace using the Fetch API. It logs the created workspace's name and ID to the console. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/workspace', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'My New Workspace' }) }); const { workspace } = await response.json(); console.log(`Created workspace: ${workspace.name} (ID: ${workspace.id})`); ``` -------------------------------- ### Get File Entry with Python Source: https://docs.drime.cloud/api-reference/files/get-file-entry Retrieve file entry information using Python's requests library. This snippet shows how to send the GET request with an authorization header. ```python import requests entry_id = 485529678 response = requests.get( f'https://app.drime.cloud/api/v1/file-entries/{entry_id}', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) file_entry = response.json()['fileEntry'] ``` -------------------------------- ### Make First API Request (JavaScript) Source: https://docs.drime.cloud/quickstart Make your first API request using JavaScript's fetch API. Include your access token in the Authorization header. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/cli/loggedUser', { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }); const data = await response.json(); console.log(data.user); ``` -------------------------------- ### Get Folder Path using cURL Source: https://docs.drime.cloud/api-reference/files/get-folder-path Use this cURL command to make a request to the Get Folder Path API. Ensure you replace 'YOUR_ACCESS_TOKEN' with your actual authentication token. ```bash curl https://app.drime.cloud/api/v1/folders/MTExMzQ0fHBhZA/path \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Folder Count using JavaScript Source: https://docs.drime.cloud/api-reference/files/get-folder-count This JavaScript snippet demonstrates how to make a request to the API to get the item count for a folder. Ensure you replace YOUR_ACCESS_TOKEN with your valid token. ```javascript const folderId = 123; const response = await fetch( `https://app.drime.cloud/api/v1/folders/${folderId}/count`, { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } } ); const { count } = await response.json(); console.log(`Folder contains ${count} items`); ``` -------------------------------- ### Get Logged User with JavaScript Source: https://docs.drime.cloud/api-reference/user/get-logged-user This JavaScript code snippet demonstrates how to make a request to get the logged-in user's details using the Fetch API. It includes setting the Authorization header. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/cli/loggedUser', { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }); const data = await response.json(); console.log(data.user); ``` -------------------------------- ### Make First API Request (Python) Source: https://docs.drime.cloud/quickstart Make your first API request using Python's requests library. Include your access token in the Authorization header. ```python import requests headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } response = requests.get( 'https://app.drime.cloud/api/v1/cli/loggedUser', headers=headers ) print(response.json()) ``` -------------------------------- ### Get a Note by ID using cURL Source: https://docs.drime.cloud/api-reference/notes/get-note Use this cURL command to make a GET request to retrieve a specific note. Replace 'YOUR_ACCESS_TOKEN' with your actual API token and '1' with the desired note ID. ```bash curl -X GET https://app.drime.cloud/api/v1/getNote/1 \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### List File Entries with JavaScript Source: https://docs.drime.cloud/api-reference/files/get-file-entries Fetch a paginated list of file entries using JavaScript's fetch API. This example demonstrates setting query parameters and handling the JSON response. Ensure you replace YOUR_ACCESS_TOKEN. ```javascript const params = new URLSearchParams({ workspaceId: 0, perPage: 50, orderBy: 'name', orderDir: 'asc' }); const response = await fetch( `https://app.drime.cloud/api/v1/drive/file-entries?${params}`, { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } } ); const { data: files, total } = await response.json(); console.log(`Found ${total} files`); ``` -------------------------------- ### Get Shareable Link using JavaScript Source: https://docs.drime.cloud/api-reference/links/get-shareable-link This JavaScript code snippet demonstrates how to fetch a shareable link for a file entry. It makes a GET request to the API and logs the share URL if a link is found in the response. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/file-entries/123456/shareable-link', { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }); const { link } = await response.json(); if (link) { const shareUrl = `https://app.drime.cloud/drive/shares/${link.hash}`; console.log('Share URL:', shareUrl); } ``` -------------------------------- ### Get Shareable Link using Python Source: https://docs.drime.cloud/api-reference/links/get-shareable-link This Python script shows how to obtain a shareable link for a file entry. It sends a GET request with the necessary authorization header and prints the share URL if the link is successfully retrieved. ```python import requests response = requests.get( 'https://app.drime.cloud/api/v1/file-entries/123456/shareable-link', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) link = response.json().get('link') if link: print(f"Share URL: https://app.drime.cloud/drive/shares/{link['hash']}") ``` -------------------------------- ### Get Available Name using JavaScript Source: https://docs.drime.cloud/api-reference/files/get-available-name This JavaScript snippet demonstrates how to use the fetch API to get an alternative filename. It sends a POST request with the original filename and receives a suggested name, typically with a counter appended for duplicates. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/entry/getAvailableName', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'report.pdf', parentId: null, workspaceId: 0 }) }); const { name } = await response.json(); console.log(`Use filename: ${name}`); // "report (1).pdf" ``` -------------------------------- ### Create Folder using Python Source: https://docs.drime.cloud/api-reference/files/create-folder This Python snippet shows how to create a folder using the `requests` library. It sends a POST request with the required JSON payload and headers. `None` is used for the root parent ID. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/folders', params={'workspaceId': 0}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={ 'name': 'My New Folder', 'parentId': None # None = root } ) folder = response.json()['folder'] print(f"Created folder: {folder['name']} (ID: {folder['id']})") ``` -------------------------------- ### Get Notes Source: https://docs.drime.cloud/llms.txt Retrieves all notes created by the user. ```APIDOC ## GET /notes/get-notes ### Description Retrieves a list of all notes belonging to the authenticated user. ### Method GET ### Endpoint /notes/get-notes ``` -------------------------------- ### Get Tracked Files Source: https://docs.drime.cloud/llms.txt Lists all files for which tracking is enabled. ```APIDOC ## GET /tracking/get-tracked-files ### Description Retrieves a list of all files that have tracking enabled. ### Method GET ### Endpoint /tracking/get-tracked-files ``` -------------------------------- ### Get Note Source: https://docs.drime.cloud/llms.txt Retrieves a single note by its unique identifier. ```APIDOC ## GET /notes/get-note ### Description Fetches a specific note using its ID. ### Method GET ### Endpoint /notes/get-note ### Query Parameters - **note_id** (string) - Required - The ID of the note to retrieve. ``` -------------------------------- ### Move Entries using Python Source: https://docs.drime.cloud/api-reference/files/move-entries This Python example shows how to move entries using the requests library. It includes setting the workspace ID, authorization header, and the JSON payload. ```python import requests response = requests.post( 'https://app.drime.cloud/api/v1/file-entries/move', params={'workspaceId': 0}, headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={ 'entryIds': [123, 456], 'destinationId': 789 # folder ID, or None for root } ) entries = response.json()['entries'] ``` -------------------------------- ### Delete Entries (Python) Source: https://docs.drime.cloud/api-reference/files/delete-entries Use Python's requests library to delete file entries. The first example shows how to move entries to trash. The second example demonstrates how to empty the entire trash by providing an empty `entryIds` array and setting `emptyTrash` to true. ```python import requests # Move to trash response = requests.post( 'https://app.drime.cloud/api/v1/file-entries/delete', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={ 'entryIds': [123, 456], 'deleteForever': False } ) # Empty trash response = requests.post( 'https://app.drime.cloud/api/v1/file-entries/delete', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}, json={ 'entryIds': [], 'emptyTrash': True } ) ``` -------------------------------- ### Example File Entry JSON Source: https://docs.drime.cloud/concepts Represents a file or folder in Drime Cloud, including its ID, name, type, hash, parent ID, and workspace ID. ```json { "id": 123456, "name": "document.pdf", "type": "pdf", "hash": "MTIzNDU2fA", "parent_id": null, "workspace_id": 0 } ``` -------------------------------- ### Delete Entries (JavaScript) Source: https://docs.drime.cloud/api-reference/files/delete-entries Use JavaScript's fetch API to delete file entries. The first example shows how to move entries to trash. The second example demonstrates how to empty the entire trash by providing an empty `entryIds` array and setting `emptyTrash` to true. ```javascript // Move to trash const response = await fetch('https://app.drime.cloud/api/v1/file-entries/delete', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ entryIds: [123, 456], deleteForever: false }) }); // Empty entire trash const emptyTrash = await fetch('https://app.drime.cloud/api/v1/file-entries/delete', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ entryIds: [], emptyTrash: true }) }); ``` -------------------------------- ### Get Workspaces Source: https://docs.drime.cloud/llms.txt Retrieves a list of all workspaces accessible by the authenticated user. ```APIDOC ## Get Workspaces ### Description Get all workspaces the user has access to. ### Method GET ### Endpoint /user/get-workspaces ``` -------------------------------- ### Create Note using JavaScript Source: https://docs.drime.cloud/api-reference/notes/create-note Create a new note programmatically with JavaScript using the fetch API. This example demonstrates setting the Authorization header and sending the note title and body as JSON. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/notes/create', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ title: 'My New Note', body: 'This is the content of my note...' }) }); const { note } = await response.json(); console.log(`Note created: ${note.id}`); ``` -------------------------------- ### Get Shareable Link Source: https://docs.drime.cloud/llms.txt Retrieves information about an existing shareable link. ```APIDOC ## GET /links/get-shareable-link ### Description Fetches details about a specific shareable link, including its settings and associated entry. ### Method GET ### Endpoint /links/get-shareable-link ### Query Parameters - **link_id** (string) - Required - The ID of the shareable link. ``` -------------------------------- ### Register User with cURL Source: https://docs.drime.cloud/api-reference/auth/register Use this cURL command to register a new user. Ensure the Content-Type header is set to application/json and the request body contains the required email, password, and device_name. ```bash curl -X POST https://app.drime.cloud/api/v1/auth/register \ -H "Content-Type: application/json" \ -d '{ "email": "newuser@example.com", "password": "securepassword123", "device_name": "My App" }' ``` -------------------------------- ### Create Workspace using cURL Source: https://docs.drime.cloud/api-reference/user/create-workspace Use this cURL command to create a new workspace. Ensure you replace YOUR_ACCESS_TOKEN with your actual token. ```bash curl -X POST https://app.drime.cloud/api/v1/workspace \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My New Workspace" }' ``` -------------------------------- ### Get User Folders Source: https://docs.drime.cloud/llms.txt Retrieves the entire folder structure for a user. ```APIDOC ## GET /files/get-user-folders ### Description Fetches the complete tree of folders belonging to the authenticated user. ### Method GET ### Endpoint /files/get-user-folders ``` -------------------------------- ### Register Source: https://docs.drime.cloud/llms.txt Creates a new user account in the Drime Cloud system. ```APIDOC ## POST /auth/register ### Description Creates a new user account. Requires a unique username and a strong password. ### Method POST ### Endpoint /auth/register ### Request Body - **username** (string) - Required - The desired username for the new account. - **password** (string) - Required - The password for the new account. - **email** (string) - Required - The user's email address. ``` -------------------------------- ### Get Folder Path Source: https://docs.drime.cloud/llms.txt Retrieves the hierarchical path for a given folder. ```APIDOC ## GET /files/get-folder-path ### Description Generates the breadcrumb path leading to a specific folder, showing its location within the directory structure. ### Method GET ### Endpoint /files/get-folder-path ### Query Parameters - **folder_id** (string) - Required - The ID of the folder for which to get the path. ``` -------------------------------- ### Get Notifications Source: https://docs.drime.cloud/llms.txt Fetches a list of notifications associated with the user's account. ```APIDOC ## Get Notifications ### Description Get user notifications. ### Method GET ### Endpoint /user/get-notifications ``` -------------------------------- ### Get Tracking Stats Source: https://docs.drime.cloud/llms.txt Retrieves detailed tracking statistics for a specific file. ```APIDOC ## GET /tracking/get-tracking-stats ### Description Provides detailed statistics related to the tracking of a specific file, such as view counts or download history. ### Method GET ### Endpoint /tracking/get-tracking-stats ### Query Parameters - **file_id** (string) - Required - The ID of the file for which to get tracking statistics. ``` -------------------------------- ### Initialize Multipart Upload with JavaScript Source: https://docs.drime.cloud/api-reference/multipart/create-multipart This JavaScript code snippet demonstrates how to initiate a multipart upload using the Fetch API. It sends a POST request with a JSON body containing file information and logs the returned uploadId and key. ```javascript const response = await fetch('https://app.drime.cloud/api/v1/s3/multipart/create', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ filename: file.name, mime: file.type, size: file.size, extension: file.name.split('.').pop(), workspaceId: 0 }) }); const { key, uploadId } = await response.json(); // Store these for subsequent operations console.log(`Upload initialized: ${uploadId}`); ``` -------------------------------- ### Get Vault Entries Source: https://docs.drime.cloud/llms.txt Lists all files and their metadata stored within the encrypted vault. ```APIDOC ## Get Vault Entries ### Description List files in the encrypted vault. ### Method GET ### Endpoint /vault/get-vault-entries ``` -------------------------------- ### Get Available Name Source: https://docs.drime.cloud/llms.txt Retrieves an available filename if the desired name already exists. ```APIDOC ## GET /files/get-available-name ### Description Checks if a filename is available in a given folder and returns a unique name if it's not. ### Method GET ### Endpoint /files/get-available-name ### Query Parameters - **folder_id** (string) - Optional - The ID of the folder to check within. Defaults to root. - **name** (string) - Required - The desired filename. ``` -------------------------------- ### Get Workspace Source: https://docs.drime.cloud/api-reference/user/get-workspace Fetches detailed information for a specific workspace by its ID. Requires an authorization token. ```APIDOC ## GET /api/v1/workspace/{id} ### Description Returns detailed information about a specific workspace. ### Method GET ### Endpoint /api/v1/workspace/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The workspace ID ### Request Example ```bash cURL curl https://app.drime.cloud/api/v1/workspace/1873 \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ```javascript JavaScript const workspaceId = 1873; const response = await fetch( `https://app.drime.cloud/api/v1/workspace/${workspaceId}`, { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } } ); const { workspace } = await response.json(); ``` ```python Python import requests workspace_id = 1873 response = requests.get( f'https://app.drime.cloud/api/v1/workspace/{workspace_id}', headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'} ) workspace = response.json()['workspace'] ``` ### Response #### Success Response (200) - **workspace** (object) - The workspace object with all details - **status** (string) - Request status (`success`) #### Response Example ```json 200 - Success { "workspace": { "id": 1873, "name": "My Workspace", "avatar": "https://www.gravatar.com/avatar/...", "owner_id": 15843, "created_at": "2025-12-18T18:39:07.000000Z", "updated_at": "2025-12-18T18:39:07.000000Z", "members_count": 3, "currentUser": { "role_name": "Workspace Owner", "email": "user@example.com", "role_id": 3, "is_owner": true } }, "status": "success" } ``` ``` -------------------------------- ### Create Folder using cURL Source: https://docs.drime.cloud/api-reference/files/create-folder Use this snippet to create a new folder via the command line using cURL. Ensure you replace 'YOUR_ACCESS_TOKEN' with your actual API token. ```bash curl -X POST "https://app.drime.cloud/api/v1/folders?workspaceId=0" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My New Folder", "parentId": null }' ```