Forum Discussion

Saintenr's avatar
Saintenr
Copper Contributor
Mar 11, 2021
Solved

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 th...
  • Saintenr's avatar
    Saintenr
    Jan 27, 2022
    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

Resources