Once I copy a file from a user's folder to our Production folder, I try to create a shared link for it and it fails; or I try to list the shared link and it fails. By fail, I referring to not returning the expected URL. This has me going bananas. Either creating a shared link or listing it returns none 😞
def move_file_to_Baby_Dream(item_found):
global babydream_path
global babydream_web_path
global source_path
global destination_path
source_path = source_path + item_found
if "WEB" in item_found.upper():
destination_path = babydream_web_path + item_found
else:
destination_path = babydream_path + item_found
result = dbx.files_copy_v2(source_path, destination_path)
print(result)
shared_link_metadata = dbx.sharing_list_shared_links(
destination_path)
print(shared_link_metadata)
# can raise exceptions.ApiError
result = dbx.files_delete(source_path)
print(result)
iterm in question:
processing item Beach Vibes (GO) 6x8 WEB.jpg
Result from the copy:
RelocationResult(metadata=FileMetadata(client_modified=datetime.datetime(2023, 3, 12, 14, 58, 39),
content_hash='d16046346d27c2b9ebe0c60dfac996b0cb57f3897b2d9c815ee116208d82f336',
export_info=NOT_SET, file_lock_info=NOT_SET, has_explicit_shared_members=NOT_SET, id='id:uyXC_hRuuQsAAAAAAAK7Hg',
is_downloadable=True, media_info=NOT_SET,
name='Beach Vibes (GO) 6x8 WEB.jpg', parent_shared_folder_id='9728791664',
path_display='/Baby Dream CSV WEB/Beach Vibes (GO) 6x8 WEB.jpg',
path_lower='/baby dream csv web/beach vibes (go) 6x8 web.jpg',
preview_url=NOT_SET, property_groups=NOT_SET, rev='015f9d8de48c2c70000000243e19470',
server_modified=datetime.datetime(2023, 4, 21, 13, 45, 21),
sharing_info=FileSharingInfo(modified_by='dbid:AADeY4jnPnF-ARQRTYUMOxc6-ANf3mvEh68',
parent_shared_folder_id='9728791664', read_only=False), size=1251420, symlink_info=NOT_SET))
2nd Print command:
ListSharedLinksResult(cursor=NOT_SET, has_more=False, links=[])