That works like a charm. I am then using IFTTT with an applet that looks for new files in this folder and then creates a Tumblr post with the file, using it's previewUrl as the caption. This preview URL is by default only allowing me as the owner to see the file. I'm looking into if there is a way to give the file public access when uploading it.
The /2/sharing/create_shared_link_with_settings endpoint is the right way to create a shared link for a file, e.g., for public access. Can you print out the response body you get from that call? It should contain either the result, with the created shared link, or an error indicating why the call failed.