Hi, I observed a different response from list shared link API for those sub folders under a team folder.
There is a folder test0327 under a Team Folder, the path is /Team Folder For Integration Test/test0327
Its metadata is:
{
".tag": "folder",
"name": "test0327",
"parent_shared_folder_id": "2375939763",
"id": "id:0b3RzxZNBvUAAAAAAAAAeg",
"shared_folder_id": "2417396531",
"sharing_info": {
"read_only": false,
"parent_shared_folder_id": "2375939763",
"shared_folder_id": "2417396531",
"traverse_only": false,
"no_access": false
}
}
And I've edit this folder's access through Admin Console to make this folder only be accessed with userA and userB.
Now I use a team Admin's team_member_id as Select-User to make requests to list shared links API with/without Dropbox-API-Path-Root and use id/shared_folder_id respectively.
Below are the results:
❯ curl -s -XPOST -H "Authorization: Bearer $dt" -H "Content-Type: application/json" -H "Dropbox-API-Select-User: $AdminTeamMember_id" -d '{"path": "id:0b3RzxZNBvUAAAAAAAAAeg", "direct_only": true}' https://api.dropboxapi.com/2/sharing/list_shared_links | jq .
{
"error_summary": "permission_denied/.",
"error": {
".tag": "permission_denied"
}
}
❯ curl -s -XPOST -H "Authorization: Bearer $dt" -H "Content-Type: application/json" -H "Dropbox-API-Select-User: $AdminTeamMember_id" -H "Dropbox-API-Path-Root: {\".tag\": \"root\", \"root\": \"2103744179\"}" -d '{"path": "id:0b3RzxZNBvUAAAAAAAAAeg", "direct_only": true}' https://api.dropboxapi.com/2/sharing/list_shared_links | jq .
{
"error_summary": "permission_denied/",
"error": {
".tag": "permission_denied"
}
}
❯ curl -s -XPOST -H "Authorization: Bearer $dt" -H "Content-Type: application/json" -H "Dropbox-API-Select-User: $AdminTeamMember_id" -d '{"path": "ns:2417396531", "direct_only": true}' https://api.dropboxapi.com/2/sharing/list_shared_links | jq .
{
"error_summary": "path/not_found/..",
"error": {
".tag": "path",
"path": {
".tag": "not_found"
}
}
❯ curl -s -XPOST -H "Authorization: Bearer $dt" -H "Content-Type: application/json" -H "Dropbox-API-Select-User: $AdminTeamMember_id" -H "Dropbox-API-Path-Root: {\".tag\": \"root\", \"root\": \"2103744179\"}" -d '{"path": "ns:2417396531", "direct_only": true}' https://api.dropboxapi.com/2/sharing/list_shared_links | jq .
{
"links": [],
"has_more": false
}
As you can see, when using id:0b3RzxZNBvUAAAAAAAAAeg as path, I got the permission denied response with or without Path-Root header, which might be expected I think, however, when using ns:2417396531, I got two different responses with/without Path-Root header.
So I was wondering:
1) Which response is expected actually ?
2) Do I need to use Path-Root header or not since the API document does not mention this ?
3) Should I use shared_folder_id or id as path parameter?
4) Is there any way to list shared links with WholeTeamAdmin header?
Above response and behavior is really confusing, please can anyone help clarify or fix that ? Thanks!