I am sorry but I do not follow. Do I still have to know the @Value(user_name) and @Value(folder_id) for all users and items I would like to check? I am using authentication so I do not have to generate token I think
Yes, it depends on how how you work, we only have one user we use to publish GIS data, but if you have multiple users steps would be: Get all users, Get all folders and items for each user, Get all items in each folder of each user.
An alternative to get all users is to use User Search
https://<portal-url>/sharing/rest/community/users
as this can be done with a regular user.
The way I develop these things is to do the action I want in portal while having developer window (F12) open. I then see which requests are made to get the results and reproduce these with HttpCallers.
Be aware that the account you are using to list the items, must have permission to see the other users items. Not tested but I think an admin account can do this, but not sure.
Because of this (need to be shared with to seee) we use one account to publicate stuff, as ESRI does on AGOL.