getPublicFile method

Future<List<int>> getPublicFile({
  1. required Object publicId,
  2. required Object name,
  3. Map<String, Object?>? query,
  4. Map<String, String>? headers,
})

GET /{version}/files/public/{PublicId}/{Name*}

Reads a file somebody made public from the Hub side (makeFilePublic / makeFolderPublic).

No sign-in. This is the one call in the SDK that deliberately goes out with no credentials, because the link has to work in an e-mail, in an <img src>, or in a browser on a stranger's phone. The unguessable nbpf_… id is the whole credential.

Answers with the file's raw bytes. When the storage provider can sign its own links (Amazon S3, Azure Blob, Google Cloud Storage) the gateway replies 302 and the HTTP client follows it, so the bytes come straight from the provider and never pass through Norbix.

Every miss — unknown id, wrong name, made private again, file gone — is the same plain 404. That is deliberate: a more precise answer would tell a stranger that the file exists.

name is the file's name for a file link, or the path inside the folder for a folder link (2026/q1/report.pdf); its slashes stay slashes.

Implementation

Future<List<int>> getPublicFile({
  required Object publicId,
  required Object name,
  Map<String, Object?>? query,
  Map<String, String>? headers,
}) {
  return transport.sendBytes(
    route: '/{version}/files/public/{PublicId}/{Name*}',
    method: 'GET',
    query: query,
    headers: headers,
    pathParams: <String, Object?>{'PublicId': publicId, 'Name': name},
    authenticated: false,
  );
}