Protocol

POST new_blob

Upload a new blob.

POST https://baq.run/api/alice/blobs

The blob to upload is the sole content of the request.

Headers

  • Content-Length int

    • Size of the blob in bytes.

    • Required to upload a blob.

Content

  • hash BlobHash

    • SHA256 hash of the uploaded blob.
  • size int

    • Size of the uploaded blob in bytes.
  • expires_at RecordDate

    • Date before which this blob should be linked to in a record.

In this example we upload a short text file containing the word Hello.

POST /api/alice/blobs HTTP/2
Host: baq.run
Content-Length: 6
Content-Type: text/plain

Hello\n

The response provides us with the hash to use in a Blob link­, and tells us by when we can use that blob in a record before it expires.

HTTP/2 200 OK
Content-Type: application/json

{
  "hash":"66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18",
  "size":6,
  "expires_at":"2024-03-07T07:48:19.2320000Z"
}
© 2024 Quentez