Data Bundleの作成
キャプチャデータをアップロードする前に、特定のキャプチャデバイスに紐づいた空のData Bundleが必要です。作成は2ステップのフローです。Data Bundleデバイス入力ツリーを取得し、選択したリーフデバイスの完全に解決されたdbuPathでBundleを作成します。入力ツリーは1回の呼び出しで返されます。nameとchildrenでローカルに走査し、リーフに到達するまで進めます。リーフノードには作成時に渡すdbuPath文字列が含まれます。ブランチノードはdbuPath: nullです。
エンドポイント
Section titled “エンドポイント”| メソッド | パス | スコープ | 用途 |
|---|---|---|---|
GET | /v1/organization/{organizationId}/data-bundle-input-tree | read:bundle | デバイス入力ツリーの取得 |
POST | /v1/nodes/{parentId}/bundle | write:bundle | Data Bundleの作成 |
ステップ1:入力ツリーの取得
Section titled “ステップ1:入力ツリーの取得”GET {api_url}/v1/organization/{organizationId}/data-bundle-input-treeAuthorization: Bearer {access_token}レスポンスはネストされたツリーです。各ノードには以下が含まれます:
| フィールド | 意味 |
|---|---|
name | パス構築に使用する安定した識別子 |
label | 人間が読める表示名 |
isLeaf | ノードが選択可能なキャプチャデバイスの場合はtrue |
dbuPath | リーフノードの完全に解決されたデバイスパス。ブランチではnull |
children | 子ノード(リーフでは空配列) |
例(省略あり):
{ "nodes": [ { "name": "POINTCLOUD", "label": "Point Cloud", "isLeaf": false, "dbuPath": null, "children": [ { "name": "ZF", "label": "ZF", "isLeaf": false, "dbuPath": null, "children": [ { "name": "ZFSLAM", "label": "ZF SLAM", "isLeaf": true, "dbuPath": "POINTCLOUD/ZF/ZFSLAM", "children": [] } ] } ] } ]}isLeafがtrueになるまでツリーを走査し、dbuPathをコピーします(ここではPOINTCLOUD/ZF/ZFSLAM)。
ステップ2:Bundleの作成
Section titled “ステップ2:Bundleの作成”権限を持つ親ノード(通常はサイトまたはフォルダ)の下にBundleを作成します。Bundle名とステップ1のリーフdbuPathを渡します。
POST {api_url}/v1/nodes/{parentId}/bundleAuthorization: Bearer {access_token}Content-Type: application/json
{ "name": "ZF capture 2026-06-01", "dbuPath": "POINTCLOUD/ZF/ZFSLAM" }{ "id": "a6f75b3c-f261-4b27-9a2a-9a6cc1234c53", "name": "ZF capture 2026-01-01", "dbuPath": "POINTCLOUD/ZF/ZFSLAM"}返されたidを、アップロード、処理、ダウンロードの各ステップでbundleIdとして使用します。
エラーケース
Section titled “エラーケース”| ステータス | 原因 |
|---|---|
400 Bad Request | dbuPathが不明、リーフではない、または利用不可 |
403 Forbidden | 親ノードに権限がない、またはコンテンツアクセスがない |
import requests
API_URL = "https://<your-regional-api-url>"TOKEN = "<access_token>"ORG_ID = "<organization_id>"PARENT_ID = "<site-or-folder-id>"
headers = {"Authorization": f"Bearer {TOKEN}"}
tree = requests.get( f"{API_URL}/v1/organization/{ORG_ID}/data-bundle-input-tree", headers=headers,).json()
# Walk the tree to find the ZF SLAM leaf (your navigation logic may differ).def find_dbu_path(nodes, *path): node = nodes for segment in path: node = next(n for n in node if n["name"] == segment) node = node["children"] leaf = node[0] assert leaf["isLeaf"] return leaf["dbuPath"]
dbu_path = find_dbu_path(tree["nodes"], "POINTCLOUD", "ZF", "ZFSLAM")
bundle = requests.post( f"{API_URL}/v1/nodes/{PARENT_ID}/bundle", headers=headers, json={"name": "ZF capture 2026-01-01", "dbuPath": dbu_path},).json()
bundle_id = bundle["id"]print(f"Created bundle {bundle_id} for device {bundle['dbuPath']}")次のステップ
Section titled “次のステップ”bundleIdを取得したら、Data Bundleへのデータアップロードに進んでください。