For generating public URL of attachments is gone through ( ) The only difference in attachment and documents is attachments have parentId, so file can be visible at record related list level.īetter check with public links for downloading attachments using public URL no need to login salesforce if clink links the respective file automatically downloads. If it's a success no need to look into response body. You can set this link as a redirect page at you created custom URL apex class only (IF you want any help on this ask me I'll send you draft code).So if the apex class is calling the above link the particular file automatically gets downloaded. If you want to download attachments u can redirect u r url with passing id of record. So my suggestion is create your own apex class having strong endpoint URL with HTTPGET method for returning direct body instead of another URL(as showning in standard response) and this response also will give you in string format only. In the same SF URLs wt u gave for calling Attachment to just getting id and Success response here YOU won't expect attachment body.and also you hitting standard salesforce Endpoint URL.So it's returning another URL for body. Thank you for any help insight you are able to provide! There's no way I am the first person to attempt this!Īs per my knowledge if you give any request the response will give you in string format.So based on ur response you need to do some logic. Which, I've tried determine and find without success, and I have searched throughout the system very thoroughly and have not been able to determine what the document/attachment IDs are for the files that I am attemptign to test download with.Īlso, what are the differences between documents and attachements? Should I be using the Files API instead? It appears that the only way to download the file according to the SFDC documentation, listed in link below, is by providing a document/attachment ID.
I am able to successfully authenticate, and perform other calls. I am simply trying to invocate a GET request call to download a file/document, previously uploaded to Salesforce, from Salesforce.