Block gateway

5 endpoints · Overview

GET/chunks/{hash}

Download one chunk as plaintext (get ticket)
TicketBlock gateway

Parameters · path

  • hashHashrequired
    ^[0-9a-f]{64}$

Parameters · query

  • tstringrequired
    Ticket from upload-sessions or download-tickets

Responses

  • 200
    Bytes
    string (binary)
  • 4xx/5xx
    Error
    Error
Example request
curl "https://blocks.side.space/chunks/9f2c4e6a8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a?t=TICKET"

PUT/chunks/{hash}

Upload one chunk (put ticket). The gateway checks BLAKE3(body) == hash; an existing chunk answers 200 without rewriting.
TicketBlock gateway

Parameters · path

  • hashHashrequired
    ^[0-9a-f]{64}$

Parameters · query

  • tstringrequired
    Ticket from upload-sessions or download-tickets

Request body application/octet-stream

Responses

  • 200
    Already stored
  • 201
    Stored
  • 4xx/5xx
    Error
    Error
Example request
curl -X PUT "https://blocks.side.space/chunks/9f2c4e6a8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a?t=TICKET" \
  --data-binary @A001_C003.mov

GET/files/{version_id}

Whole file as a stream, with Range support (get ticket bound to this version). Only chunks overlapping the range are read.
TicketBlock gateway

Parameters · path

  • version_idstringrequired

Parameters · query

  • tstringrequired
    Ticket from upload-sessions or download-tickets
  • downloadstring
    File name for Content-Disposition attachment

Parameters · header

  • Rangestring

Responses

  • 200
    Full body
  • 206
    Partial body
  • 4xx/5xx
    Error
    Error
Example request
curl "https://blocks.side.space/files/ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T?t=TICKET"

POST/stream-upload

Upload a whole file; the gateway chunks and stores it and returns the manifest (put ticket)
TicketBlock gateway

Parameters · query

  • tstringrequired
    Ticket from upload-sessions or download-tickets

Request body application/octet-stream

Responses

Example request
curl -X POST "https://blocks.side.space/stream-upload?t=TICKET" \
  --data-binary @A001_C003.mov
Example response · 200
{
  "algo": "fastcdc-v1",
  "size": 734003200,
  "chunks": [
    {}
  ]
}

POST/edit

Apply byte edits to the version the ticket names (a put ticket with manifest_hash, made by the server for POST …/edits) and return the new manifest. Only the chunks around the edits are read, chunked and stored.
TicketBlock gateway

Parameters · query

  • tstringrequired
    Ticket from upload-sessions or download-tickets

Request body application/json

  • opsobject[]required
    Sorted, non-overlapping, offsets in the old file
    › 3 fields
    • atinteger (int64)required
    • deleteinteger (int64)
      default 0
    • datastring (byte)
      New bytes
  • truncateinteger (int64)
    Cut the result to this many bytes afterwards

Responses

Example request
curl -X POST "https://blocks.side.space/edit?t=TICKET" \
  -H "Content-Type: application/json" \
  -d '{"ops":[{"at":1}]}'
Example response · 200
{
  "algo": "fastcdc-v1",
  "size": 734003200,
  "chunks": [
    {}
  ]
}