SOLVED

How many members have viewed a file in a SharePoint document library.

Copper Contributor

Hello Community, I would like to make a continuous evaluation of my files in SharePoint. For this purpose I am looking for the information how many people have viewed a certain file. How can I get this information through the SharePoint API?
Unfortunately, I can't find the column that contains this information. Maybe this info is also stored in another system list?

Saintenr_0-1615449010875.png

Thanks for your response
Saintenr

2 Replies
Hi, also looking to do this. Did you find a solution?
best response confirmed by Saintenr (Copper Contributor)
Solution
Hi, yes i found a solution to get this each file:

https://xxx.sharepoint.com/_api/v2.1/drives/${driveId}/items/${itemId}/getActivitiesByInterval(start...}')

You need the ${driveId} of your SharePoint library, this is not the library id!!
${itemId} is the UniqueId of the document not the short ID
${startDate} and ${endDate} should have this format 'yyyy-mm'
as ${interval} i used 'month' but i think 'day' any 'year should also possible.

good luck, cheers Saintenr
1 best response

Accepted Solutions
best response confirmed by Saintenr (Copper Contributor)
Solution
Hi, yes i found a solution to get this each file:

https://xxx.sharepoint.com/_api/v2.1/drives/${driveId}/items/${itemId}/getActivitiesByInterval(start...}')

You need the ${driveId} of your SharePoint library, this is not the library id!!
${itemId} is the UniqueId of the document not the short ID
${startDate} and ${endDate} should have this format 'yyyy-mm'
as ${interval} i used 'month' but i think 'day' any 'year should also possible.

good luck, cheers Saintenr

View solution in original post