When you access any resource which is not public access, shared link access denied error will be thrown and this is logical too.
So to solve such an issue, first, create a sharable link allowing public access or adding member-only to share the particular resources.
1 : Create Sharable Resources
https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_...
2: Now Get a link to share :
https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links
Call this API first, if there is no sharable link, it will return an empty list else it will provide a sharable link that can be access by the public.
If the list is empty call API mentioned in 1 and you will get a sharable link.
3: If you want to share this link and want the resource can be downloaded programmatically, e.g creating QR code of sharable link and once scan be any other user, the particular resource should be downloaded.
https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file