You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Developers
26 TopicsWelcome to the Dropbox Developer Community!
Welcome to the Dropbox Developer Community! This is aspacewhere you canget help, provide feedback, brainstorm ideas,make connections,and get inspired. The Dropbox team is here to help with questions, file bugs, and report your feedback.We also encourage all community membersto jump in and support eachother. Here are just some of the things you can do in theDropbox Developer Community forum: Get help Ask questionsabout specific issues or roadblocks Brainstorm how to use the Dropbox API to solve your technical and/or business needs Review tips, examples, and tutorials Help others Share your expertise, experiences, and insights to answer questions from other community members and participate in discussions Share examples, stories, and code samplesof the work you have done on the DBX Platform Influence DBX Platform Provide feedback and file feature requestswith the Dropbox team Alert us to potential bugs with our endpoints and SDKs Stay in the loop Get the latest announcements and updates from Dropbox Get invited to participate in feedback sessions, surveys, and developerevents Have fun Get to know the Dropbox team and other developers in the community Earnbadges,kudos, and levels Right now, we have two main categories withinthe DropboxDeveloper Community: API Support & Feedback Thispageis meant for gettingtechnical support from the Dropbox team and community about specific API issues, as well as providing product feedback and feature requests. The Dropbox team is here to help answer questions, file bugs, and report your feedback about the DBX Platform. If you think you know the answer to a question or have experienced something similar, please feel free to chime in. General Discussion The general discussion page covers everything else, from Dropbox announcements, to sharing code samples, to brainstorming your start up ideas. We encourage all community members to contribute content that will help other developers and engage in the conversations here. If you’re new to the communitystart hereto get an overview of how to post, reply, earn badges, and more. Please help us keep the Dropbox Developer Community respectful and helpful by abiding by ourCommunity Guidelines. Thank you forbeing a part ofthe Dropbox Developer Community! We’re looking forward to getting to know you. - The DBX Platform Team15KViews0likes0CommentsSharing folders to users with viewer still permits downloads
I am working on an integration for our business that uses the API to shared a folder's content with an email attached to the order. Previously we used Google Drive to solve this but have experienced some issues and we would like to make Dropbox our new home. At the moment, I am granting the email addressed attached to the order viewer access like so: const url = 'https://api.dropboxapi.com/2/sharing/add_folder_member'; const payload = { members: [ { access_level: "viewer", member: { ".tag": "email", email: "email@addr.ess" } }, ], quiet: true, shared_folder_id: "<folder_id>" }; Essentially it does grant the user viewer access however they still have the option to download the folders content. Is there a way that we can restrict this? Essentially we are trying to prevent file sharing of our businesses documents.GET TEAM FOLDER SIZE
Hi, I want to get the folder size for all my team folders. I am excecuting the following code in python using dropbox SDK : import dropbox import dropbox.team import time from concurrent.futures import ThreadPoolExecutor from logging_config import logger def team_folder(dbx_team, member_id_admin, save_client😞 start_time = time.time() logger.info('Executing extraction of team folders') result = dbx_team.team_team_folder_list() team_folders = result.team_folders folder_details = [] for folder in team_folders: folder_info = { "ID": folder.team_folder_id, "Name": folder.name } folder_details.append(folder_info) #save as json block logger.info("Team folder details have been saved to team_folder.json") end_time = time.time() logger.info("Finished team_folder method in %.2f seconds", end_time - start_time) list_all_contents_teamFolders(folder_details, dbx_team, member_id_admin, save_client) def handle_listing_result(result, namespace😞 """Processes each page of file/folder entries. Refer to the documentation for information on how to use these entries: https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder""" teamFolder_files = [] for entry in result.entries: entry_size = getattr(entry, 'size', 0) # Use '0' if size attribute is not present entry_parent_shared_folder_id = getattr(entry, 'parent_shared_folder_id', '') entry_dict = { "type": str(type(entry)), "path": entry.path_lower, 'size': entry_size, 'parent_shared_folder_id': entry_parent_shared_folder_id, 'namespace_id': namespace } teamFolder_files.append(entry_dict) return teamFolder_files def process_namespace(dbx_admin_with_ns, namespace_id, save_client😞 logger.info(f"Processing namespace: {namespace_id}") teamFolder_files = [] try: listing_result = dbx_admin_with_ns.files_list_folder( path="", recursive=True, include_media_info=False, include_mounted_folders=True ) teamFolder_files = handle_listing_result(listing_result, namespace_id) while listing_result.has_more: listing_result = dbx_admin_with_ns.files_list_folder_continue(cursor=listing_result.cursor) teamFolder_files.extend(handle_listing_result(listing_result, namespace_id)) path_to_save = 'teamFolderSpace/' + namespace_id + '_pathFilesTeamFolder.json' logger.info(f"Uploading files to blob: {path_to_save}") .....save block....... logger.info(f"Upload completed: {path_to_save}") logger.info(f"Finished processing namespace: {namespace_id}") return teamFolder_files except dropbox.exceptions.InternalServerError as e: return logger.error(f"An unexpected error occurred: {e}") except Exception as e: return logger.error(f"An unexpected error occurred: {e}") def list_all_contents_teamFolders(folders_id, dbx_team, member_id_admin, blob_client😞 start_time = time.time() start_position=0 namespace_ids = [folder['ID'] for folder in folders_id] with ThreadPoolExecutor(max_workers=5) as executor: # Adjust max_workers as needed futures = [] for i, namespace_id in enumerate(namespace_ids[start_position:], start=0😞 logger.info(f'Submitting folder {i + 1}/{len(namespace_ids)} with id {namespace_id}') future = executor.submit(process_namespace, dbx_admin.with_path_root(dropbox.common.PathRoot.namespace_id(namespace_id)), namespace_id, blob_client) futures.append(future) .......save block............ end_time = time.time() logger.info("Finished team_folder method in %.2f seconds", end_time - start_time) return "Finished team_folder method" However the excecuting time is extremely long. How can I get the same more efficiently?423Views0likes1CommentHow to determine admin user to be used in select_admin for team folders?
I am using below api to get the list of all users. How to determine the admin from these users I need to use his/her id for select_admin: in subsequent calls for listing team folders const url = 'https://api.dropboxapi.com/2/team/members/list_v2'; const headers = { Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json', };Embedder and tags
I have a HTML page that offers a textbox in which the viewer can write certain keywords. After clicking ENTER, the images are loaded in iframes according to the keywords. My problem is: how do I write this is JS so that it can be integrated on a Dropbox Embedder app? Also, I did not find a way to know if I should tag all images in Dropbox or modify their metadata in advance? I expect that all images with same keyword are shown in page, inside their respective iframes.Solved979Views0likes9CommentsListing team folders and content
I need a critical help with question below. i am developing a backup and restore solution which backups data from dropbox and store in s3 bucket. I am using typescript lambda to achieve the same Now I have been so far successful listing the users in a dropbiox business account and listing their files and folders successfully Some snippets of code related to it are List users:https://api.dropboxapi.com/2/team/members/list_v2 Fetch team_member_id for these users Create dropbox client using const dbx: any = new Dropbox({ accessToken: access_token, fetch: fetch, selectUser: team_member_id }); Recursively call below to get all files and folders for that particular team member. Please note the access token is obtained using oauth flow using admin account if (cursor === "") { result = await retry(() => dbx.filesListFolder({ path: "", recursive: true })); } else { result = await retry(() => dbx.filesListFolderContinue({ cursor })); } Now I need to list all the team folders and its content too along with user specific content For it I tried Getting list of team folders using : const teamFolderUrl = 'https://api.dropboxapi.com/2/team/team_folder/list'; Get the team_folder_id Create dropbox client using const dbx: any = new Dropbox({ accessToken: access_token, fetch: fetch, }); Recursively call below to get all files and folders for that particular team member. Please note the access token is obtained using oauth flow using admin account if (cursor === "") { result = await retry(() => dbx.filesListFolder({ path: "/team_folder", recursive: true })); } else { result = await retry(() => dbx.filesListFolderContinue({ cursor })); } but I am getting error error: `Error in call to API function "files/list_folder": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user <https://www.dropbox.com/developers/documentation/http/teams>.` require your help in detailed understanding of the issue886Views0likes10CommentsSubject: Issues Adding Tags to Files Using Dropbox API with Refresh Token and Appropriate Scopes
Hello Dropbox Community, I'm encountering an issue when trying to add tags to files using the Dropbox API. Here’s a brief overview of my setup and the problem I’m facing: Setup: - API Version: Dropbox API v2 - Authentication: OAuth 2.0 with a refresh token - Scopes: My app is configured with the necessary individual scopes, including `files.metadata.write` and `file_properties.write`. - Functionality: I’m attempting to add custom tags to files using the `/file_properties/properties/add` endpoint. Problem: Despite having all the necessary permissions and the access token being generated via a refresh token with the correct scopes, I’m unable to successfully add tags to files. The API call fails, and I receive an error response, which suggests that the operation is not permitted or that there is an issue with my setup. Here is a summary of the steps I’m taking: 1. Authorization: I authenticate using a refresh token to obtain an access token. 2. API Request: I send a POST request to the `https://api.dropboxapi.com/2/file_properties/properties/add` endpoint with the required parameters: - `path`: The path to the file where I want to add the tag. - `property_groups`: The tag information, including the template ID and the tag value. 3. Error: The API responds with an error indicating that the tag cannot be added. What I’ve Tried: - Ensured that the access token is valid and has the required scopes. - Verified that the file path and template ID are correct. - Tested the API call with both shared and non-shared files, and ensured that the file is accessible with the current token. Question: Has anyone else encountered a similar issue with adding tags using the Dropbox API? Is there something I might be missing in my setup or the API call? Any insights or suggestions would be greatly appreciated. Thank you in advance for your help! --- Feel free to post this in the Dropbox community forums. This detailed description should provide enough context for others to understand your issue and offer potential solutions.Solved700Views0likes2CommentsHow to configure the domain to the chooser's frame-ancestor
Hi~I used the chooser's iframe embedding (as shown in the code). However, it's not displaying correctly due to frame-ancestor restrictions. How can I add my domain to frame-ancestor? Is this in the app's setting page? It doesn't seem to work. Thanks in advance~ const comp = new Dropbox.Chooser({ appKey: "", onSuccess: () => { }, onCancel: () => { }, linkType: "preview", }) Dropbox.mount(comp, document.getElementById("container"));374Views0likes2CommentsDrop box js sdk
this.dbxAuth = new DropboxAuth({ clientId: dropboxConfig.clientId, clientSecret: dropboxConfig.clientSecret, }) i am stroing the refreshToken from const tokenResponse = await this.dbxAuth.getAccessTokenFromCode( dropboxConfig.redirectUri, code, ) this method . const scopes = [ 'account_info.read', 'file_requests.read', 'file_requests.write', 'files.content.write', 'files.metadata.read', ] const dbx = new DropboxAuth({ refreshToken: refreshToken, clientId: dropboxConfig.clientId, clientSecret: dropboxConfig.clientSecret, }) refreshedToken = await dbx.refreshAccessToken(scopes but not able to refresh token . error: { error: 'invalid_request', error_description: 'No auth function available for given request' } actually do we need to refresh ? it is so confusing. the docs also makes no sense to me.Solved551Views0likes3CommentsHow to delete all files in a folder by API
Hi API Team, I am using dropbox folders temporarily to upload videos to youtube. I need to clean/delete files from Dropbox files after I upload them to youtube since I don't need them anymore and to free up space in Dropbox. 1. Do you have a setting where we can set time to delete files? ex: every day, every Monday at 23:59 2. Do you have a cron job/automation/bot/software that will clean folders for example at 23:59 every day? I am able to delete individual files and folders as follows (API Doc): curl -X POST https://api.dropboxapi.com/2/files/permanently_delete \ --header "Authorization: Bearer " \ --header "Content-Type: application/json" \ --data "{\"path\": \"/Homework/math/Prime_Numbers.txt\"}" How to delete all files in a folder with out deleting the folder? Something like *.* for all files: { "path": "/uploads/*.*" } I could not interpret the path pattern -pathString(pattern="(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)") Can you please guide me to delete all files in a folder ? Thanks!Solved4.8KViews0likes6Comments