Product Documentation
HomepageLoginSign up
  • Welcome to Biodock
  • Why Biodock
  • Quickstart
    • Start here (choose a tutorial)
    • Path 1: AI-assisted analysis
    • Path 2: Train a fully-automated AI model
      • Set up your project
      • Label and train
      • Labeling shortcuts
      • Run your AI model
      • Configuring your model
  • AI Projects
    • Project settings
    • Sharing your AI project
    • Training a model
  • AI Analysis
    • Results dashboard overview
    • Download results and reports
    • Correcting results to improve your model
    • Editing objects (QC)
    • Filters (like flow cytometry)
  • Biodock Scripts
    • Biodock Platform Script Guidelines
  • Files
    • Uploading images
    • AWS S3 integration
    • View and manage data
      • Viewing images
      • File details and download
      • Copy, cut, move
      • Sharing data
      • Merging channels
    • Supported image types
  • Public API (Beta)
    • Overview
    • Authentication
    • Examples
    • Resources
      • Files
      • Analysis Jobs
      • Pipelines
    • Limitations
  • Deep AI models
    • Evaluating Performance
  • User
    • Account registration
    • Change password, login, logout
    • Usage limits and team
      • Filesize based limits
      • Run credits limits
    • Billing
  • Company
    • Academics and startups
    • Contact us
    • Citing Biodock
    • Security and IP
Powered by GitBook
On this page
  • Upload file
  • List filesystem items
  • Sample Usage
  1. Public API (Beta)
  2. Resources

Files

The public API supports uploading files up to 2 GB. If you would like to upload files larger than this, they must be uploaded using the website.

To upload a file, use the following endpoint:

Upload file

POST https://app.biodock.ai/api/external/filesystem-items/upload-file

Headers

Name
Type
Description

X-API-KEY*

String

API key.

Request Body

Name
Type
Description

fileName*

String

Desired name of file in the Biodock filesystem.

destinationFolder

String

Desired parent folder of file in the Biodock filesystem. Will create folders if they do not exist. Defaults to the root folder.

upload*

file

File to upload.

{
    id: "0123456789",
    __t: "File"
}

To view items in the Biodock filesystem, use the following endpoint:

List filesystem items

GET https://app.biodock.ai/api/external/filesystem-items

Query Parameters

Name
Type
Description

limit

Number

Maximum number of results to show.

startingAfter

String

Pagination cursor id.

folderId

String

Parent folder id. Will default to root folder.

Headers

Name
Type
Description

X-API-KEY*

String

API key.

{
    results: [{
        id: "0123456789",
        name: "my_file.png",
        createdAt: "2000-01-01T00:00:00.001Z",
        __t: "File"
    }, 
    {
        id: "1234567890",
        name: "my_folder",
        createdAt: "2000-01-01T00:00:00.001Z",
        __t: "Folder"
    }],
    count: 2
}

Sample Usage

Upload a file

import requests

API_KEY = "" # Replace with your api key
FILE_TO_UPLOAD = "" # Replace with your file path
DESIRED_FILENAME = "" # Replace with your desired filename
DESIRED_FOLDER = "" # Replace with your desired folder

URL = "https://app.biodock.ai/api/external/filesystem-items/upload-file"

with open(FILE_TO_UPLOAD, "rb") as file_to_upload:
    data = {"fileName": DESIRED_FILENAME, "destinationFolder": DESIRED_FOLDER}
    headers = {"X-API-KEY": API_KEY}
    files = {"upload": file_to_upload}
    response = requests.post(URL, data=data, headers=headers, files=files)
    print(response.text)

List filesystem items in the root folder

import requests

API_KEY = "" # Replace with your api key

URL = "https://app.biodock.ai/api/external/filesystem-items"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.get(URL, headers=headers)
print(response.text)

List filesystem items in a different folder

import requests

API_KEY = "" # Replace with your api key
FOLDER_ID = "" # Replace with your folder id

URL = f"https://app.biodock.ai/api/external/filesystem-items?folderId={FOLDER_ID}"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.get(URL, headers=headers)
print(response.text)
PreviousResourcesNextAnalysis Jobs

Last updated 2 years ago