Skip to content
Get started

Retrieve a worker file

workers.retrieve_file(strfile_path, WorkerRetrieveFileParams**kwargs) -> BinaryResponseContent
GET/api/workers/{workerId}/files/{filePath}

Retrieve a file published from a worker workspace. The runtime route accepts nested paths after /files/.

ParametersExpand Collapse
worker_id: str
file_path: str
ReturnsExpand Collapse
BinaryResponseContent

Retrieve a worker file

import os
from handinger import Handinger

client = Handinger(
    api_key=os.environ.get("HANDINGER_API_KEY"),  # This is the default and can be omitted
)
response = client.workers.retrieve_file(
    file_path="scratchpad/plan.md",
    worker_id="t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM",
)
print(response)
content = response.read()
print(content)
Returns Examples