In this video, we will show you how to Read related files from Salesforce.
Due to the salesforce file model, in order to get the file data you will need to do the following:
1. query salesforce for ContentDocumentLink where the LinkedEntityId =: your record id.
2. query salesforce for ContentDocument where the ContentDocumentId IN: ContentDocumentLink.ContentDocumentId.
3. Finally, you can query the ContentVersion where the ContentVersion.ContentDocumentId IN ContentDocument record id.
4. You can now map the ContentVersion body as needed.
Find out more: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_content.htm