Read a document's bytes as an authorised link visitor
Streams a document's bytes under its recorded content type to a visitor holding an open viewing session.
GET /v1/dataroom/view/{linkId}/document/{documentId}/file
| Address | https://api.hanzo.ai/v1/dataroom/view/{linkId}/document/{documentId}/file |
| Method | GET |
| Operation | get_dataroom_view_by_linkid_document_by_documentid_file |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Streams a document's bytes under its recorded content type to a visitor holding an open viewing session.
No principal: ?viewId= from the authenticate step is the authorisation and must belong to this link, or the call is 403 — holding the link id alone gets no bytes. The document must be reachable THROUGH this link (a member of the room the link opens, or the single document the link names), so a visitor cannot walk to an unrelated document by guessing an id; anything else is a 404, as is an unknown or archived link. Bytes that cannot be fetched from object storage are 502.
?download=1 additionally requires the link's allowDownload and is 403 when the owner did not permit it. Read that flag precisely: it gates the DOWNLOAD intent, not access to the bytes — without the parameter an authorised visitor is served the file for in-place viewing whether or not downloads are allowed.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
linkId | path | string | yes | |
documentId | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo dataroom view document file <linkId> <documentId>import { Configuration, DataroomApi } from 'hanzoai';
const api = new DataroomApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getDataroomViewByLinkidDocumentByDocumentidFile({ linkId: 'linkId', documentId: 'documentId' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DataroomApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DataroomApi(client).get_dataroom_view_by_linkid_document_by_documentid_file(link_id='linkId', document_id='documentId')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.DataroomAPI.GetDataroomViewByLinkidDocumentByDocumentidFile(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, dataroom_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = dataroom_api::get_dataroom_view_by_linkid_document_by_documentid_file(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DataroomApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new DataroomApi(client).getDataroomViewByLinkidDocumentByDocumentidFile();curl https://api.hanzo.ai/v1/dataroom/view/<linkId>/document/<documentId>/file \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches dataroom through the dataroom tool, which names its 17 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_dataroom_analytic_dataroom"
}
}
}'How is this guide?