We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

dsoprea's avatar
dsoprea
Helpful | Level 6
11 months ago

Folders that are visible from the SDK don't appear to be visible via the CLI

We have a "Full Dropbox" app installed on a team account. We're setting DROPBOX_MANAGE_APP_KEY and DROPBOX_MANAGE_APP_SECRET. I've also tried with DROPBOX_PERSONAL_APP_KEY and DROPBOX_PERSONAL_APP_SE...
  • dsoprea's avatar
    dsoprea
    11 months ago

    Okay. Yes. That's what I was missing. I saw enough entries that has non-None team-member IDs that I missed that the one I was looking for had a None one.

     

    Yes. That's fine. I'm not dealing with pagination given that this is a PoC that didn't require it.

     

    Since this is a team-level folder, I've just enumerated the members and grabbed the first one:

    # Get team-scoped resource
    dbxt = dropbox.dropbox_client.DropboxTeam(
            app_key=_DROPBOX_KEY,
            app_secret=_DROPBOX_SECRET,
            oauth2_refresh_token=_DROPBOX_REFRESH_TOKEN)
    
    # Get members
    
    result = dbxt.team_members_list()
    
    # Grab the first member returned
    
    first_member_id = None
    for member in result.members:
        first_member_id = member.profile.team_member_id
        break
    
    assert \
        first_member_id is not None, \
        "No members found."
    
    # Get the namespace whose root we want to use
    
    r = dbxt.team_namespaces_list()
    namespace_id = None
    for namespace in r.namespaces:
        if namespace.name != 'ManagedIntake':
            continue
    
        namespace_id = namespace.namespace_id
    
    assert \
        namespace_id is not None, \
        "Could not find images namespace."
    
    # Get object scoped to the member and root-path above
    
    dbxtm = dbxt.as_user(first_member_id)
    
    path = dropbox.common.PathRoot.namespace_id(namespace_id)
    dbxtmp = dbxtm.with_path_root(path)
    
    result = dbxtmp.files_list_folder("")
    for entry in result.entries:
        print(entry.name)

     

    So, that works, and works as desired.

     

    How would the account-level access work? Since all of our apps would have to be team-scoped, are you just saying that removing the team-scopes will magically allow the app to have account -specific access? I had originally created a separate app for this and hadn't given it any team-scopes, but I was unable to even see this folder, presumably because it lives in the team space. Is that accurate?