cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you new to Dropbox? Our Newcomers group is the perfect place to learn the basics, find out more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

list_folder / get_file_metadata not returning path_lower

list_folder / get_file_metadata not returning path_lower

jerry14
Explorer | Level 4
Go to solution

Hi,

 

I am trying the list_folder & get_file_metadata APIs, but both of them doesn't seem to be returning path_lower/path information in FileMetadata. The value is null. I tried from my java code and from the API explorer. Response from API explorer is below.  (from https://dropbox.github.io/dropbox-api-v2-explorer/#sharing_get_file_metadata)

 

The account I am trying to connect is a Business Account.

 

{
  "access_type": {
    ".tag": "editor"
  },
  "id": "id:IDHERE",
  "name": "filename",
  "owner_team": {
    "id": "dbtid:OWNERIDHERE",
    "name": "abc"
  },
  "parent_shared_folder_id": "42234440401",
  "policy": {
    "member_policy": {
      ".tag": "anyone"
    },
    "resolved_member_policy": {
      ".tag": "anyone"
    },
    "acl_update_policy": {
      ".tag": "editors"
    },
    "shared_link_policy": {
      ".tag": "anyone"
    },
    "viewer_info_policy": {
      ".tag": "enabled"
    }
  },
  "preview_url": "https://www.dropbox.com/scl/fi/k7wbl8c7hm9z4jvekfwwz/filename...",
  "time_invited": "2022-08-10T17:34:35Z"
}

 

 

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

In this case, this would be because you're using asAdmin as to administratively access team content on behalf of an admin, who may not necessarily have that content mounted in their account.

 

To get the path values, you'll need to make the call in a context where the content is mounted, such as by doing any of the following, as applicable/desired:

  • use withPathRoot to set the root for the call to somewhere where the content is mounted (e.g., a team space, or a member folder)
  • switch to using asMember instead of asAdmin, if the admin does have the content mounted in their account
  • switch to using asMember instead of asAdmin and instead specify the member ID for a member that does have the content mounted in their account

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

If the path fields aren't set, e.g., in the metadata for an item returned by /2/files/list_folder[/continue] or /2/sharing/get_file_metadata, that indicates that the item isn't "mounted" in the account/root for the call, and so does not have a path to include.

 

The File Access Guide, Sharing Guide, and Team Files Guide may be useful references.

 

If you believe this is occurring erroneously, please show us how you're configuring the call so we can take a look. Just be sure to redact the access token.

jerry14
Explorer | Level 4
Go to solution

Thanks. I went through the documentation, still unable to pinpoint the issue. I am calling list folder API using folder id, is that the reason?  

 

ListFolderResult listFolderResult = dbxTeamClient.asAdmin(<ADMINID>)
.files()
.listFolderBuilder(<FOLDER_ID>)
.withRecursive(true)
.start();

 

Greg-DB
Dropbox Staff
Go to solution

In this case, this would be because you're using asAdmin as to administratively access team content on behalf of an admin, who may not necessarily have that content mounted in their account.

 

To get the path values, you'll need to make the call in a context where the content is mounted, such as by doing any of the following, as applicable/desired:

  • use withPathRoot to set the root for the call to somewhere where the content is mounted (e.g., a team space, or a member folder)
  • switch to using asMember instead of asAdmin, if the admin does have the content mounted in their account
  • switch to using asMember instead of asAdmin and instead specify the member ID for a member that does have the content mounted in their account

jerry14
Explorer | Level 4
Go to solution

@Greg-DB Thanks. Setting withPathRoot resolved the issue. 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    jerry14 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?