I want to collect all the documents owned by each User in Salesforce account.
I have created accessToken with User A's email, where User A is a System Admin with property PermissionsModifyAllData and PermissionsViewAllData is true.
For User A we get all docs for which he is owner of but for all other users we get docs in which User A is a shared permisison by directly shared or with Domain shared i.e. when trying to query docs for let say User B we are not able to get docs in which User B is owner but it is not shared with User A.
I am using below SOQL with accessToken created with User A's login.
https://testdomain.salesforce.com/services/data/v48.0/queryAll?q=select Id, Title, Description, ContentSize, isDeleted, OwnerId, ParentId, LastModifiedDate, LastModifiedById, CreatedDate, FileType, FileExtension, PublishStatus from ContentDocument where OwnerId = '005XXXX000XXXX00XX'
Any lead to solve this usecase will be much appreciated.