Meeting Attendance Reports not working with SDK

Dipika Das 141 Reputation points
2022-11-09T06:48:29.507+00:00

Hi,

For my project I want to get attendance report of a meeting. So I found an api in the graph document to get this attendance report, that I'm getting when I'm trying to fetch it using graph explorer.

But problem is when I'm using the code snippet to as mentioned in the image below it's giving compile error that "IOnlineMetingRequestBuilder" could not found the "AttendanceReports". And also from explorer I'm using not using beta version still it's working. Please check the below attached images for more clarity and let me know if anyone have solution to achieve this using sdk
258558-attendencegraphexplorer.png.

258509-attendencegraohcode.png

Thanks In Advance

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,124 questions
0 comments No comments
{count} votes

Accepted answer
  1. Srinivasa Rao Darna 6,701 Reputation points Microsoft Vendor
    2022-11-09T10:42:32.973+00:00

    Hi @Dipika Das ,

    I don't see any build errors with AttendanceReports in Graph SDK for dotnet, I am using Microsoft.Graph v4.17 and v4.47.

    msgraph-sdk-dotnet
    Microsoft.Graph
    258751-attendancereports.png

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


1 additional answer

Sort by: Most helpful
  1. CarlZhao-MSFT 39,101 Reputation points
    2022-11-09T08:43:42.237+00:00

    Hi @Dipika Das

    Referring to my test code, it worked just fine.

    using Azure.Identity;   
    using Microsoft.Graph;  
    using Newtonsoft.Json;  
          
    var scopes = new[] { "OnlineMeetingArtifact.Read.All" };  
      
    var tenantId = "tenant id";  
      
    // Values from app registration  
    var clientId = "client id";  
    var clientSecret = "client secret";  
      
    // For authorization code flow, the user signs into the Microsoft  
    // identity platform, and the browser is redirected back to your app  
    // with an authorization code in the query parameters  
    var authorizationCode = "auth code";  
      
    // using Azure.Identity;  
    var options = new TokenCredentialOptions  
    {  
        AuthorityHost = AzureAuthorityHosts.AzurePublicCloud  
    };  
      
    // https://learn.microsoft.com/dotnet/api/azure.identity.authorizationcodecredential  
    var authCodeCredential = new AuthorizationCodeCredential(  
        tenantId, clientId, clientSecret, authorizationCode, options);  
      
    var graphClient = new GraphServiceClient(authCodeCredential, scopes);  
      
    var attendanceRecords = await graphClient.Me.OnlineMeetings["online meeting id"].AttendanceReports["report id"].AttendanceRecords  
        .Request()  
        .GetAsync();  
      
    Console.WriteLine("attendanceRecords:" + JsonConvert.SerializeObject(attendanceRecords));  
    

    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.

    0 comments No comments