I want to run a SOQL query that fetches files associated with opportunities(in a particular stage). If I am not wrong content version is the actual object I need to be querying on to fetch content? Here is the query I am running
SELECT IsAssetEnabled, Checksum, ContentBodyId, ContentLocation, ContentModifiedDate, Origin, ContentUrl, ContentDocumentId, Id, CreatedById, CreatedDate, Description, ExternalDataSourceId, ExternalDocumentInfo1, ExternalDocumentInfo2, FeaturedContentBoost, FeaturedContentDate, FileExtension, SharingPrivacy, FileType, IsDeleted, FirstPublishLocationId, LastModifiedById, IsLatest, LastModifiedDate, IsMajorVersion, OwnerId, NegativeRatingCount, PathOnClient, PositiveRatingCount, SharingOption, PublishStatus, RatingCount, ContentSize, ReasonForChange, SystemModstamp, TagCsv, TextPreview, Title, ContentModifiedById, VersionData, VersionNumber FROM ContentVersion
How do I add the column in the query that tells me what opportunity is this file associated with, plus how do I fetch files associated with the opportunity in XYZ stage only?
I am running this query in G-connector for salesforce, when the above query runs I get the data in spreadsheet, how do I convert this data to the actual file png, JP, Pdf whatever it is, to make it usable for other application?