Forum Discussion
Saintenr
Mar 11, 2021Copper Contributor
How many members have viewed a file in a SharePoint document library.
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?
Thanks for your response
Saintenr
- Hi, yes i found a solution to get this each file:
https://xxx.sharepoint.com/_api/v2.1/drives/${driveId}/items/${itemId}/getActivitiesByInterval(startDateTime='${startDate}',endDateTime='${endDate}',interval='${interval}')
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
- Martina_HawkinsCopper ContributorHi, also looking to do this. Did you find a solution?
- SaintenrCopper ContributorHi, yes i found a solution to get this each file:
https://xxx.sharepoint.com/_api/v2.1/drives/${driveId}/items/${itemId}/getActivitiesByInterval(startDateTime='${startDate}',endDateTime='${endDate}',interval='${interval}')
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