API sharing_get_shared_links succeeds when I first copy the link from the dropbox manually. It shows:
https://www.dropbox.com/s/pexagwz8il76t1k/Beach%20Vibes%20-%206x8%20-%20GO%20WEB.jpg?dl=0 on Copy Link
as well as in Python code. No difference.
The next entry in the folder fails to get sharing_get_shared_links without me manually doing a Copy Link.
The sharing_create_shared_link_with_settings returns:
CreateSharedLinkWithSettingsError('shared_link_already_exists', SharedLinkAlreadyExistsMetadata('metadata', FileLinkMetadata(client_modified=datetime.datetime(2022, 5, 26, 19, 42, 59), content_owner_team_info=NOT_SET, expires=NOT_SET, id='id:Fpt6TPwBUf0AAAAAAAA-Nw', link_permissions=LinkPermissions(allow_comments=False, allow_download=True, audience_options=[LinkAudienceOption(allowed=True, audience=LinkAudience('public', None), disallowed_reason=NOT_SET), LinkAudienceOption(allowed=True, audience=LinkAudience('team', None), disallowed_reason=NOT_SET), LinkAudienceOption(allowed=True, audience=LinkAudience('no_one', None), disallowed_reason=NOT_SET)],
can_allow_download=True, can_disallow_download=True, can_remove_expiry=True, can_remove_password=True, can_revoke=True, can_set_expiry=True, can_set_password=True, can_use_extended_sharing_controls=True, effective_audience=LinkAudience('public', None), link_access_level=LinkAccessLevel('viewer', None), requested_visibility=RequestedVisibility('public', None), require_password=False, resolved_visibility=ResolvedVisibility('public', None), revoke_failure_reason=NOT_SET, team_restricts_comments=False, visibility_policies=[VisibilityPolicy(allowed=True, disallowed_reason=NOT_SET, policy=RequestedVisibility('public', None), resolved_policy=AlphaResolvedVisibility('public', None)), VisibilityPolicy(allowed=True, disallowed_reason=NOT_SET, policy=RequestedVisibility('team_only', None), resolved_policy=AlphaResolvedVisibility('team_only', None)), VisibilityPolicy(allowed=True, disallowed_reason=NOT_SET, policy=RequestedVisibility('password', None), resolved_policy=AlphaResolvedVisibility('password', None))]), name='Beach Vibes - 6x8 - GO.jpg', path_lower='/test_app/beach vibes (go)/beach vibes - 6x8 - go.jpg', rev='602ac3dc075db6a49d3d3', server_modified=datetime.datetime(2023, 8, 11, 21, 17, 33), size=68850796, team_member_info=TeamMemberInfo(display_name='Spencer Treadwell', member_id='dbmid:AAD0RjvblA75FwxwxOysVcw5sM1X7rbEfXw', team_info=Team(id='dbtid:AABwTGjgmzPm2JVb_S_Pf5GBZ0wgZwZ2J9w', name='baby dream')), url='https://www.dropbox.com/scl/fi/7qfp06kxnj965fxgysk64/Beach-Vibes-6x8-GO.jpg?rlkey=hkvkhmvc4wtmog2mhrjueauq2&dl=0')))
I then stop the program and and do a copy link of the failed sharing_get_shared_links within dropbox and get
https://www.dropbox.com/scl/fi/7qfp06kxnj965fxgysk64/Beach-Vibes-6x8-GO.jpg?rlkey=hkvkhmvc4wtmog2mhrjueauq2&dl=0 exactly as in the exception. Instead of a /s/ it has a /scl/fi meaning what? What is causing this and how can it be rectified?
Thank you in advance.
Cris Rodriguez
try:
shared_link_metadata = dbx.sharing_get_shared_links(path=save_product_path)
if shared_link_metadata.links:
iterator = iter(shared_link_metadata.links)
for item in iterator:
shared_link = item.url
else:
shared_link_metadata = dbx.sharing_create_shared_link_with_settings(
save_product_path)
shared_link = shared_link_metadata.url