capabilities.work

Provision Bucket and Upload First File

A 4-step recipe with Backblaze. We can help you get access.

Recipe · 4 steps

Provision Bucket and Upload First File

Create a bucket and upload the first file into it.

  1. Log in to the B2 API to obtain the accountId and authorization token used by the bucket and upload steps.
  2. Create the new bucket that will hold the uploaded file.
  3. Request an upload URL and token for the bucket that was just created, using the bucketId returned by the create step.
  4. Upload the first file to the new bucket using the upload authorization token and the required X-Bz content metadata headers.
What you'll need to have ready
  • bucketName: Globally unique name for the new bucket.
  • bucketType: Privacy setting for the bucket (allPublic or allPrivate).
  • fileName: URL-encoded name of the first file to upload.
  • contentType: MIME type of the file being uploaded.
  • contentLength: Length of the file content in bytes.
  • contentSha1: SHA1 checksum of the file content.
  • fileContent: The raw file bytes to upload as the request body.
For your developer

Arazzo workflow backblaze:provision-bucket-and-upload, 4 operations: authorizeAccount → createBucket → getUploadUrl → uploadFile. Specs on APIs.io.