You need to sign in to do that
Don't have an account?
Barton Ledford
ConnectApi.Files Class Unavailable
Does anyone know why the ConnectApi.Files class would be unavailable in an org?
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_Files_static_methods.htm?search_text=contentcapability#apex_ConnectAPI_Files_getFilePreview_1
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_Files_static_methods.htm?search_text=contentcapability#apex_ConnectAPI_Files_getFilePreview_1
NOTE: When including code, please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
The same functionality is available in the Chatter REST API in v35.0 in case it helps:
https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_files_preview_format.htm
A workaround in Apex would be to make an HTTP callout to the REST endpoint -- not very nice, but I can't think of a better way.