function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mahesh chandramahesh chandra 

get all files through Chatter REST API

Through Chatter REST API, it is possible to get list of files per user using following query:
/services/data/v34.0/chatter/users/00590000003A2nmAAC/files
In order list all files in an organization, we need to query for all users separately which will result in consumption of so many API calls.
Is there any way to get all files in an organization using a single API call?
logontokartiklogontokartik
Can you use Apex Code? You can use ContentDocument to get all file details.

If you want to use REST API, maybe you can get all files by a Group.
/chatter/groups/groupID/files
https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_groups_GroupFiles.htm?search_text=file
mahesh chandramahesh chandra
Thanks for the response Kartik.

No, I need to get the files through REST API.
ContentDocument doesn't return personal files of other users, but Chatter REST API provides the same. Chatter REST API has the limitation of querying per user.
Querying files for Group can only return files in that Group.
In order to get files for an organization, I may query the files for the chatter group created in the name of the organization. But in case, the group has been archived, the feeds get cleared and I am getting a blank list of files. Another problem is if files have been uploaded to a private group, where the admin is not a member, the files cannot be listed.