As a system administrator, I want to fetch all the files uploaded by a specific user. I found out that using the request to GET /services/data/v48.0/query/?q=SELECT+Id+FROM+ContentDocument+USING+SCOPE+Everything
I can fetch all the files from my organization uploaded by different users.
Can I do the same for a specific user? If yes, then how?
Does this require the user`s access token to fetch files and also upload them? Or can it be done using only system admin token?
I'm not sure you need SCOPE
. System Administrator will have "View All Data, Query All Files", should be enough according to the docs. Check the profile/permission sets, experiment a bit.
This should be a good start:
SELECT Id, OwnerId, CreatedById, Title
FROM ContentDocument
WHERE CreatedById = '005...' OR OwnerId = '005...'
You'll need to know the user's Id
or you can do JOINs (called relationship queries in SF) WHERE CreatedBy.Username = 'x@y.com'