Skip to main content
SalesForce Devs,

 

I am simply trying to invocate a GET request call to download a file/document, previously uploaded to Salesforce, from Salesforce. I am able to successfully authenticate, and perform other calls. 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. 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.

Also, what are the differences between documents and attachements? Should I be using the Files API instead?

 

https://developer.salesforce.com/docs/api-explorer/sobject/Attachment

https://developer.salesforce.com/docs/api-explorer/sobject/Document

 

Thank you for any help insight you are able to provide! There's no way I am the first person to attempt this!

 

RF

 
5 respuestas
  1. 20 nov 2019, 14:14
    Hi Vijay,

    That is very helpful, but I dont think it fully addresses my issue. I will add clarification.

    End goal: To be able to download all files from SFDC for a specific user, opportunity, lead, etc. by calling an SFDC API, and providing the Object type (user, opportunity, lead, etc.) and the ID associated with that user, opportunity, lead, etc.

    Also, I have not been able to obtain/identfiy the attachment ID nor Document ID. I tried to determin what the document ID is, to attempt to download it from the Attachment/document APIs. I searched the UI, and associated objects that may provide the document/attachment ID.

    From your post, it sounds like the document/attachment ID will work with an APEX class that redirect me to a seperate URL for download. How do I first get the attachment/document ID?

    After uploading 3 files to a lead I created in the SFDC UI, I am able to make the files public, and download them. I performed an inspection on the networking traffic they produce when downloading, I found certain ID numbers etc. but am unable to confirm they are the ID numbers that I need. Please note the End goal I listed above, is there no simple way to tap into SFDC APIs after authenticating to download releavant attachments to an object?

    Thanks again for your help!

    Ricky