You need to sign in to do that
Don't have an account?

How to share a chatter post file programmatically to user
Hello All,
We can share a file posted on the chatter using GUI to a user , I am trying to achive the same in apex but not getting which object stores that information . ContentVersion is the object stores file but where how the sharing is stored ?
Regards,
Atul
The sharing information of Chatter files is stored in the ContentDocumentLink, see the document:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_contentdocumentlink.htm
but this object is read only.
You can query the current sharing info. but cannot insert new sharing.
I see that a new record is getting inserted into ContentDocument when I upload an image to chatter feed from the record detail page. I am able to query it but the images uploaded by other users are not part of the query. It looks like when we upload an image, it is privately shared. How to automatically make the chatter images visible to all the users? Thank you!