getTeamsUserActivityUserDetail Graph API call in SPFx

Brass Contributor

Hello SharePoint Users,

I'm developing an SPFx webpart to pull the MS Teams user activity details.

I have given the solution the Reports.Read.All permission in the package and in the Azure portal (API permissions), granted the API access in the SharePoint admin portal as well.

But i still get the 403 forbidden error-

GET https://graph.microsoft.com/beta/reports/getTeamsUserActivityUserDetail(period='D7')?$format=applica... 403 (Forbidden)

 

Here is the code segment that i use (pasting only the relevant part). I'm using same approach for getting the current users Team names and members displayed. Those methods work fine.

Any help appreciated.

Thanks.

Kevin

 

    this.props.context.msGraphClientFactory
    .getClient()
    .then((client:MSGraphClient:(void=>{
      client
      .api(`/reports/getTeamsUserActivityUserDetail(period='D7')?$format=application/json`)
      .version('beta')
      .select("userPrincipalName")
      .get((err,res)=>{
         if(err){
           console.log("Error logs "err);
           return;
         }

 

0 Replies