Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.
API
5731 TopicsCan Dropbox API enable permanent share link extraction?
I used the Dropbox API to export file metadata, including titles, paths, created dates, and Dropbox links, into an Excel sheet for my employer. In my script, I enabled the "file.metadata.read", "sharing.write" and a few other .read permissions. However, the extracted links are "null" all the time. Below is my script generated by ChatGPT. Could someone help me identify if there’s an issue with it? Alternatively, does Dropbox restrict sharing links to temporary ones because I’m using an employee account? #!/bin/bash ACCESS_TOKEN="#my_access_token" TARGET_FOLDER="/Sales Material/Customer-facing Tools" OUTPUT_FILE=~/Desktop/customer_facing_tools_metadata.csv # Create the CSV file and write the header echo "Document Name,Path,Dropbox Link,Type,Created Date" > "$OUTPUT_FILE" # Iterate over files in the local directory find "/Sales Material/Customer-facing Tools" -type f | while read -r FILE_PATH; do # Extract the file name FILE_NAME=$(basename "$FILE_PATH") # Construct the relative path for Dropbox RELATIVE_PATH=${FILE_PATH#"/Sales Material/Customer-facing Tools/"} # Clean the constructed Dropbox path DROPBOX_PATH="$TARGET_FOLDER/$RELATIVE_PATH" DROPBOX_PATH=$(echo "$DROPBOX_PATH" | sed 's#//*#/#g') # Remove duplicate slashes # Debugging: Print paths echo "FILE_PATH: $FILE_PATH" echo "RELATIVE_PATH: $RELATIVE_PATH" echo "CLEANED DROPBOX PATH: $DROPBOX_PATH" # Determine the file type based on the extension EXTENSION="${FILE_NAME##*.}" case "$EXTENSION" in jpg|jpeg|png|gif|bmp|webp|tif|tiff) FILE_TYPE="Image" ;; pdf) FILE_TYPE="PDF" ;; doc|docx|txt) FILE_TYPE="Document" ;; xls|xlsx|csv) FILE_TYPE="Spreadsheet" ;; *) FILE_TYPE="Other" ;; esac # Fetch the permanent Dropbox link DROPBOX_RESPONSE=$(curl -s -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings \ --header "Authorization: Bearer $ACCESS_TOKEN" \ --header "Content-Type: application/json" \ --data "{\"path\": \"$DROPBOX_PATH\", \"settings\": {\"requested_visibility\": \"public\"}}") # Debugging: Log the full response echo "Dropbox Response: $DROPBOX_RESPONSE" # Extract the link from the response if echo "$DROPBOX_RESPONSE" | jq empty > /dev/null 2>&1; then DROPBOX_LINK=$(echo "$DROPBOX_RESPONSE" | jq -r '.url') # Adjust the Dropbox link to force direct download DROPBOX_LINK=$(echo "$DROPBOX_LINK" | sed 's#\?dl=0#?dl=1#g') else DROPBOX_LINK="Error fetching link" echo "Dropbox Response Error: $DROPBOX_RESPONSE" fi # Fetch the metadata for created date METADATA_RESPONSE=$(curl -s -X POST https://api.dropboxapi.com/2/files/get_metadata \ --header "Authorization: Bearer $ACCESS_TOKEN" \ --header "Content-Type: application/json" \ --data "{\"path\": \"$DROPBOX_PATH\"}") # Debugging: Log the full metadata response echo "Metadata Response: $METADATA_RESPONSE" # Extract the created date if echo "$METADATA_RESPONSE" | jq empty > /dev/null 2>&1; then CREATED_DATE=$(echo "$METADATA_RESPONSE" | jq -r '.server_modified') else CREATED_DATE="Error fetching date" echo "Metadata Response Error: $METADATA_RESPONSE" fi # Debugging: Log results echo "Extracted Dropbox Link: $DROPBOX_LINK" echo "Extracted Created Date: $CREATED_DATE" # Append the data to the CSV file echo "\"$FILE_NAME\",\"$RELATIVE_PATH\",\"$DROPBOX_LINK\",\"$FILE_TYPE\",\"$CREATED_DATE\"" >> "$OUTPUT_FILE" doneDropbox OAuth2 Issue: Scope Parameter Handling
According to OAuth2 Authorization documentation, the scope parameter is nullable, and as per RFC 6749, parameters without a value must be treated as omitted, with unrecognized parameters ignored. However, Dropbox's OAuth2 implementation returns the following error when the scope parameter is included: Error: "error": "invalid_request", "error_description": "unknown field \"scope\"" This behavior violates OAuth2 standards, as unrecognized parameters should not cause a failure.114Views0likes6CommentsDropboxAPI uploading small files
Hi! I ask for help in solving my problem. I have a Python script that runs on about 500 PCs. After running, each script writes a text file with a size of 60 bytes (approximately) and uploads it to my Dropbox folder. And I ran into such a problem that the created files can be uploaded to Dropbox indefinitely. Sometimes the file can load after 10 minutes, and sometimes after 2 hours or more. I can't figure out what this is related to, please help me figure it out. Here is a piece of my code where a file is created and uploaded to Dropbox.69Views0likes1CommentError creating shared link from API (Python)
I'm getting an error when attempting to create a shared link from a file that was just uploaded. The upload works fine, but I get the following error message. AuthError('missing_scope', TokenScopeError(required_scope='sharing.write')) I checked the scope through the App Console and sharing.write is checked, and sharing.read is also checked, although it it disabled. This is consistent with another app that I have where I am able to create shared links, however, this is not a Python APP and I am using REST calls for this one. Any idea on why I might be getting this error? Thanks, BobSolved55Views0likes2CommentsDropbox API randomly unreachable Australia
Hi, A simple telnet to 162.125.11.19 (api.dropboxapi.com) on port 443 from my OVH server in Australia fails randomly. Ping is always ok. Here is a part of the traceroute: 10 10.200.6.135 (10.200.6.135) 145.994 ms lax-la1-bb1-a9.ca.us (142.44.208.198) 147.296 ms 10.200.6.137 (10.200.6.137) 143.052 ms 11 10.200.6.135 (10.200.6.135) 145.924 ms 145.928 ms 10.200.6.137 (10.200.6.137) 146.958 ms 12 lax-b23-link.ip.twelve99.net (62.115.143.38) 196.255 ms * * 13 * lax-b23-link.ip.twelve99.net (62.115.143.38) 196.280 ms 196.258 ms 14 dls-bb2-link.ip.twelve99.net (62.115.138.64) 233.267 ms * dls-b24-link.ip.twelve99.net (62.115.136.83) 279.787 ms 15 * * * 16 chi-bb2-link.ip.twelve99.net (62.115.136.102) 257.154 ms 253.945 ms * 17 * toro-b5-link.ip.twelve99.net (62.115.136.247) 269.974 ms * Regards.Slow response using Dropbox for Python
Hello, My python code has been working well for months. Within the past 48 hours, the files_download command in the snippet below (with tokens obfuscated) has started to take about 45 seconds while previously it was instantaneous. It is the last line that is the culprit. import dropbox DROPBOX_APP_KEY = "?????" DROPBOX_APP_SECRET = "?????" DROPBOX_REFRESH_TOKEN = "????" dbx = dropbox.Dropbox(app_key=DROPBOX_APP_KEY, app_secret=DROPBOX_APP_SECRET, oauth2_refresh_token=DROPBOX_REFRESH_TOKEN) metadata, f = dbx.files_download('/alerts.csv') Any suggestions? With thanks, David137Views0likes6CommentsFile ID is not unique
I have several instances, where File ID is not unique in my Dropbox account. Below is two sets of metadata including “id”, “name”, “path_display”, “size”, “rev”, “content_hash”, “server_modified” from two different files. Filenames, paths and file sizes are different, but the first field with file id is the same. The metadata is extracted with a python script. I can send the script if needed. How can different files have identical file Ids in same account? It makes file movements and downloads based on file ID a risky action. id:hHMoQrtHqVAAAAAAAAB3ig Credenza assembly R2.stp /FORM 3D Archive/frattini/in progress/cb2, frattini, fall 2022/Office/Credenza/Drawings/Credenza assembly R2.stp 975538 015eca3c02fec960000000280bb3010 63e26b666254d76318fb0328b5999d992017c65fc2a0696b0cbf4e38d0daf832 04/11/2022 11.55.31 id:hHMoQrtHqVAAAAAAAAB3Ig Room Divider Assembly R1.stp /FORM 3D Archive/frattini/in progress/cb2, frattini, spring 2023/grid construction room divider/Drawings/Room Divider Assembly R1.stp 893028 5d6e306a534f872420641 1d9d0ed10006c9d47e259bed31d6968ce0c3f2e0ad1a6c52dc9401e94ee4c367 31/01/2022 16.10.40Solved77Views0likes3Commentsfile upload failed randomly
While uploading the document using the Dropbox API [https://content.dropboxapi.com/2/files/upload], randomly the document gets not uploaded, the file presents with 0 bytes, if i open below, ".pdf files are supported but something went wrong/ dropbox" Why? It occurs randomly, could you please check this from your end? Note: I'm using the Dropbox in Web - Windows (Basic plan)file downloads have wrong content-type header
Hello, I'm testing out dropbox v2 files api. when I call "POST https://content.dropboxapi.com/2/files/download"API, the downloaded file seems to be always returned with the content-type header set toapplication/octet-stream. Am I doing something wrong or is this to be expected? As far as I can tell the contents of file file are OK, it's just the header that's wrongSolved2.7KViews0likes3CommentsSaver API
I have a website. I want to store files from clients in dropbox servers for security reasons. So, I want to have a Form with some fields and the Saver API button for upload. When my clients use the Save API button and upload a file, will the file reside ( be it in any folder like tmp or format like a name with tmp extension etc)on my web site server and before getting transferred to dropbox servers.57Views0likes3Comments