I'm trying to generate an external download link for a Document record I've created previosly on my org.
I've tried with
URL.getSalesforceBaseUrl().toExternalForm() + '/sfc/servlet.shepherd/document/download/' + documentID
But it's not working. I've also tried with the body URL but it gives me a file with the base64 Body of the document instead of the actual file
'/services/data/v51.0/sobjects/Document/' + documentID + '/Body'
Is there a way I can accomplish this?