We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Developers
18 TopicsSharing 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?421Views0likes1CommentHow 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.Solved973Views0likes9CommentsListing 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 issue883Views0likes10CommentsSubject: 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.Solved550Views0likes3CommentsFeedback: The Embedder Launched in Preview
New feature alert! Dropbox is previewing a new pre-built component called the File and FolderEmbedder. Simply paste a JavaScript snippet into your code and you’ve added the ability to turn Dropbox shared links into interactive, embedded previews. It’s never been easier to provide your users with the ability to view and interact directly with their Dropbox files and folders. You can read more about the Embedder on our developer blog or the Embedder documentation. We want your feedback! While in the Preview phase, we’re actively adding enhancements, new controls, and new supported filetypes to the Embedder. What features would you like to see? How do your users interact with their Dropbox files from your app? Please post your thoughts or ideas about the Embedder below.Willing to give us more direct feedback? This April, we’re offering a chance to win a $200 Amazon gift card for folks that fill out this survey. Completing the survey counts as your entry into the sweepstakes*. Legal disclaimer: Navigating to the survey in this forum post will direct you to our Qualtrics survey website. All information you enter will be treated in accordance with the Dropbox Privacy Policy. Dropbox will never ask you for your password or billing information via invitations to surveys or in surveys themselves. *NO PURCHASE NECESSARY. VOID WHERE PROHIBITED BY LAW. Ends April 30, 2020 at 9:00pm Pacific Time. Must be 18+, have reached the age ofmajority in state of residence, and be a legal resident of the U.S. Sponsor: Dropbox, Inc. Odds of winning depend on the number of entries received. Click here for complete rules.14KViews12likes39Commentserror 400 when trying to Get Embedded Sign URL
Hi I'm trying toEmbedded the Dropbox sign api into my react project. im using javascript i want the user to sign in with their account and see their documents that need to be signed. when they click in a document it sends them to a page where the documents should be embedded i have the documents id and with that i can get the signature id, now when i try to make this api call it gives me an error "error_msg": "Signature request is not authorized for embedded signing.", i tried using the playground and still get the same result , any help is appreciated async function fetchEmbeddedSignUrl(signatureId) { console.log(signatureId) const response = await fetch(`https://api.hellosign.com/v3/embedded/sign_url/${signatureId}`, { method: 'GET', headers: { 'Authorization': `Basic ${btoa(API_KEY + ':')}`, 'Content-Type': 'application/json' } }); const data = await response.json(); console.log(data) return data.embedded.sign_url; }1.7KViews0likes6Comments