arazzo: 1.0.1
info:
title: Backblaze Browse Bucket Files
summary: Authorize, list buckets, list the file names in a bucket, then fetch full info for the first file.
description: >-
A read-only discovery chain for navigating account storage. It authorizes
the account, lists the buckets owned by that account, lists the file names
inside the chosen bucket, and then retrieves the full metadata for the first
file returned. The fileId of the first listed file flows into the
get-file-info call so the deepest detail is fetched without any manual
identifier handling. Every step spells out its request inline so the flow
can be read and executed without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: authorizationApi
url: ../openapi/backblaze-authorization-api-openapi.yml
type: openapi
- name: bucketsApi
url: ../openapi/backblaze-buckets-api-openapi.yml
type: openapi
- name: filesApi
url: ../openapi/backblaze-files-api-openapi.yml
type: openapi
workflows:
- workflowId: browse-bucket-files
summary: List buckets, list a bucket's files, and inspect the first file.
description: >-
Authorizes the account, enumerates buckets and the files in a target
bucket, then fetches full information for the first file found.
inputs:
type: object
required:
- bucketId
properties:
bucketId:
type: string
description: The bucket whose file names should be listed.
maxFileCount:
type: integer
description: Maximum number of file names to return (1-10000).
steps:
- stepId: authorize
description: Log in to the B2 API to obtain the accountId and authorization token.
operationId: authorizeAccount
successCriteria:
- condition: $statusCode == 200
outputs:
accountId: $response.body#/accountId
authorizationToken: $response.body#/authorizationToken
- stepId: listBuckets
description: List the buckets owned by the authorized account.
operationId: listBuckets
requestBody:
contentType: application/json
payload:
accountId: $steps.authorize.outputs.accountId
successCriteria:
- condition: $statusCode == 200
outputs:
buckets: $response.body#/buckets
- stepId: listFileNames
description: >-
List the file names contained in the target bucket, returning at most the
requested number of files.
operationId: listFileNames
requestBody:
contentType: application/json
payload:
bucketId: $inputs.bucketId
maxFileCount: $inputs.maxFileCount
successCriteria:
- condition: $statusCode == 200
outputs:
files: $response.body#/files
firstFileId: $response.body#/files/0/fileId
onSuccess:
- name: filesFound
type: goto
stepId: getFileInfo
criteria:
- context: $response.body
condition: $.files.length > 0
type: jsonpath
- stepId: getFileInfo
description: >-
Fetch the full metadata for the first file returned by the listing using
its fileId.
operationId: getFileInfo
requestBody:
contentType: application/json
payload:
fileId: $steps.listFileNames.outputs.firstFileId
successCriteria:
- condition: $statusCode == 200
outputs:
fileId: $response.body#/fileId
fileName: $response.body#/fileName
contentLength: $response.body#/contentLength
contentType: $response.body#/contentType
outputs:
buckets: $steps.listBuckets.outputs.buckets
files: $steps.listFileNames.outputs.files
inspectedFileId: $steps.getFileInfo.outputs.fileId
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.