Learn how to make the most out of the Dropbox Community here 💙!
Forum Discussion
y-otani
2 months agoNew member | Level 1
/team_folder/createで作成されたフォルダの共有化設定について
お世話になります。
/team_folder/createで作成した頂点レベルのチームフォルダの共有化設定の方法について質問があります。
現在「Dropbox API Explorer」で検証中なのですが、/team_folder/createで作成したフォルダを共有化できず困っています。
ルートレベルであれば「User Endpoints」の「add_folder_member」メンバーで可能あると認識しています。
その際必要なshared_folder_idは「list_folder」や「get_metadata」で取得可能とは承知しています。
ただ、頂点レベルのチームフォルダに対して「list_folder」や「get_metadata」をしても下記のような応答が返ってきます。
{
"error_summary": "path/not_found/",
"error": {
".tag": "path",
"path": {
".tag": "not_found"
}
}
}
また、/team_folder/createの応答は下記のとおりです。
{"team_folder_id": "hogeid", "name": "hogename", "status": {".tag": "active"}, "is_team_shared_dropbox": false, "sync_setting": {".tag": "default"}, "content_sync_settings": []}
APIで共有化する方法をご教授ください。
よろしくお願いします。
こんにちは y-otani
前のコメントに加えて、Dropbox-API-Select-Admin ヘッダーを使用して、指定したチーム管理者として Dropbox API リクエストを発行し、名前空間の相対ファイル パスを使用してチーム フォルダにアクセスできます。管理者権限があれば、チーム フォルダーにメンバーがいない場合でも、チーム フォルダーでファイル操作を実行できます。詳細については、次のリンクを参照してください。
- DBX チーム ファイル ガイド - チーム メンバーのコンテンツの管理
- DBX ファイル アクセス ガイド - パスと識別子-----------–
読みやすい翻訳をご提供できず申し訳ございません。当社からの返答にはオンライン翻訳を使用しています。どの言語にも対応することが理想ではありますが、現時点ではそれが可能ではありません。こちらが英語版です。
-----------–
Please excuse our translations. Our responses were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
-----------–Hello y-otani
In addition to the previous comment, you can use the Dropbox-API-Select-Admin header to issue Dropbox API requests as a specified team admin and access the team folder using its namespace-relative file path. With admin permissions, you can perform file operations on the team folder even if it has no members. For more information, please review the following link:
- y-otaniNew member | Level 1
ご返信ありがとうございます。
NameSpaceを使用することでidの取得ができ、グループの追加ができました。
ありがとうございます。 - iNeil
Dropbox Engineer
こんにちは y-otani
デフォルトでは、Dropbox API への API 呼び出しは、チーム フォルダが配置されている「 チーム スペース」ではなく、接続されたアカウントの「メンバー フォルダ」で実行されることに注意してください。チーム フォルダにアクセスする必要がある場合は、Dropbox API リクエストで「Dropbox-API-Path-Root」ヘッダーを設定して、API 呼び出しが「チーム スペース」で実行されるように構成する必要があります。2 /files/list_folderエンドポイントを呼び出すときに「Dropbox-API-Path-Root」ヘッダーを使用しているかどうかお尋ねしてもよろしいでしょうか。以下に、チーム スペースにアクセスするための「Dropbox-API-Path-Root」ヘッダー値の例を示します。
Dropbox-Api-Path-Root: {".tag": "root", "root": "YOUR_ROOT_NAMESPACE_ID"}
2/users/get_current_accountエンドポイントを実行すると、root_namespace_id を識別できるはずです。Dropbox API エクスプローラーを使用して 2/users/get_current_account エンドポイントをテストすることもできます。詳細については、次のリンクを確認してください。
-----------–
読みやすい翻訳をご提供できず申し訳ございません。当社からの返答にはオンライン翻訳を使用しています。どの言語にも対応することが理想ではありますが、現時点ではそれが可能ではありません。こちらが英語版です。
-----------–
Please excuse our translations. Our responses were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
-----------–Hello y-otani
Please note that, by default, API calls to the Dropbox API operate in the 'member folder' of the connected account rather than the "team space" where the team folders are located. If you need access to a team folder, you need to configure your API calls to operate in the "team space" by setting the "Dropbox-API-Path-Root" header with your Dropbox API request. May I ask if you are using the "Dropbox-API-Path-Root" header while calling the 2/files/list_folder endpoint? Below I have provided an example "Dropbox-API-Path-Root" header value to access the team space:
Dropbox-Api-Path-Root: {".tag": "root", "root": "YOUR_ROOT_NAMESPACE_ID"}
You should be able to identify the root_namespace_id by executing the 2/users/get_current_account endpoint. You can also test the 2/users/get_current_account endpoint using our Dropbox API explorer. For further information, please review the following link:
- API updates to better support team spaces
- Using the Dropbox-API-Path-Root Header
- Identifying Root Namespaces
- y-otaniNew member | Level 1
ご返答ありがとうございます。
「Dropbox-Api-Path-Root」は設定してあります。
この際使用しているトークンとアカウントは「/team_folder/create」で使用した権限となります。
フォルダーに対して権限がある場合はご提示いただいた方法でできると認識しています。
実際に管理コンソールから対象フォルダに対して共有設定すれば利用できました。
こちらが知りたいのは権限がない状態での利用方法となります。
「/team_folder/create」で作成した際、対象フォルダは誰も共有設定や所有はしていない状態です。
(管理コンソールからしかアクセスできない状態)
改めてよろしくお願いします。- iNeil
Dropbox Engineer
こんにちは y-otani
/team_folder/create エンドポイント経由で最初に新しいチーム フォルダーを作成すると、デフォルトではメンバーが存在せず、Dropbox ウェブサイトの管理コンソールにのみ表示されます。チーム フォルダーへのアクセスを許可するには、メンバーまたはグループをチーム フォルダーに追加する必要があります。 Sharing/add_folder_member エンドポイントを呼び出して、メンバーまたはグループをチーム フォルダーに追加できます。メンバーが追加されると、チーム スペース内のアカウントにチーム フォルダーが表示され、メンバーがアクセスして使用できるようになります。必要なメンバーのアクセス権と権限がなければ、チーム フォルダー内のファイル操作を実行することはできません。
-----------–
読みやすい翻訳をご提供できず申し訳ございません。当社からの返答にはオンライン翻訳を使用しています。どの言語にも対応することが理想ではありますが、現時点ではそれが可能ではありません。こちらが英語版です。
-----------–
Please excuse our translations. Our responses were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
-----------–Hello y-otani
When you first create a new team folder via the /team_folder/create endpoint, it won’t have any members by default and will only be visible in the admin console on the Dropbox website. To grant access to the team folder, you need to add members or groups to it. You can call the sharing/add_folder_member endpoint to add a member or group to the team folder. Once members are added, the team folder will appear in their accounts within the team space, allowing them to access and use it. You won’t be able to perform file operations in the team folder without the necessary member access and permissions.
About Discuss Dropbox Developer & API
Make connections with other developers810 PostsLatest Activity: 16 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!