Skip to content

Instantly share code, notes, and snippets.

@jmyzk
Last active July 3, 2023 13:18
Show Gist options
  • Save jmyzk/6ca64ccf5ad8531e3cea98d0fb32df58 to your computer and use it in GitHub Desktop.
Save jmyzk/6ca64ccf5ad8531e3cea98d0fb32df58 to your computer and use it in GitHub Desktop.
Example snippet to get url_id
dbx = dropbox.Dropbox(access_token)
folder_path = "/path/to/folder"
try:
result = dbx.files_list_folder(folder_path)
for entry in result.entries:
if isinstance(entry, dropbox.files.FileMetadata):
file_name = entry.name
url_id = entry.id.split(":")[1] # Extract the URL ID
file_url = f"https://www.dropbox.com/s/{url_id}/{file_name}"
print(f"File: {file_name}\nURL: {file_url}\n")
except AuthError as e:
print(f"Error connecting to Dropbox API: {e}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment