Hi @Koshy, Jisha Ann ext. /BSS HAM
Per my research, there is no such function to retrieve Video Viewership Retention data programmatically. There is no such method currently. As a workaround, I will recommend you to view usage data for your SharePoint site. Please refer to the following document.
https://support.microsoft.com/en-us/office/view-usage-data-for-your-sharepoint-site-2fa8ddc2-c4b3-4268-8d26-a772dc55779e
You can use following code to retrieve Site Usage Report by CSOM
clientContext.Load(clientContext.Site, s => s.Usage);
try
{
clientContext.ExecuteQuery();
UsageInfo usageInfo = clientContext.Site.Usage;
usageData = "No. of hits: " + Convert.ToString("" + usageInfo.Hits) + "; ";
usageData += "No. of visits: " + Convert.ToString("" + usageInfo.Visits) + "; ";
usageData += "Storage: " + Convert.ToString("" + usageInfo.Storage) + "; ";
usageData += "Storage Percentage Used: " + Convert.ToString("" + usageInfo.StoragePercentageUsed) + "; ";
var bytes = usageInfo.Storage;
Debug.Print("UsageData " + usageData);
Debug.Print("Bytes " + bytes);
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.