メインコンテンツまでスキップ

フォルダの移動 (Move Folder)

POST/apiv2/pub/folders/{folder_id}/movedocuments_write

フォルダを新しい親フォルダに移動します。すべての子孫のパスとドキュメントの関連付けはアトミックに更新されます。

リクエスト​

Content-Type: application/json

パスパラメータ​

パラメータ型説明
folder_idinteger移動するフォルダ。

本文​

フィールド型必須説明
new_parent_idinteger必須移動先の親フォルダ。0 はルートへの移動を意味します。

レスポンス​

200 OK — 更新された full_path を持つ、移動後のフォルダ。


エラー​

ステータス理由
400自身の子孫の中には移動できません
401トークンが無効または期限切れです
404フォルダまたは移動先が見つかりません

cURL​

curl -i -X POST "https://portal.docwize.com/apiv2/pub/folders/42/move" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"new_parent_id":99}'

{
"folder_id": 42,
"name": "Invoices",
"full_path": "Archive->Invoices",
"parent_id": 99,
"code": "a1b2c3d4-...",
"child_count": 3
}
{"detail": "Cannot move a folder into one of its own descendants"}
{"detail": "Folder not found or access denied"}