Microsoft Graph API with C# Get User detail

Arago 5 Reputation points
2024-04-10T15:32:44.8133333+00:00

I am using the example code form the MS documentation, but the code fails to compile https://learn.microsoft.com/en-us/graph/api/reportroot-getm365appuserdetail?view=graph-rest-1.0&tabs=csharp#examples Example 2 Json output.

Stream? dataStream = await graphClient.Reports.GetM365AppUserDetailWithPeriod(period).GetAsync((requestConfiguration) =>

{

 requestConfiguration.QueryParameters.Format = "application/json";

});

The complier complains about the use of Format.

Error CS1061 'DefaultQueryParameters' does not contain a definition for 'Format' and no accessible extension method 'Format' accepting a first argument of type 'DefaultQueryParameters' could be found (are you missing a using directive or an assembly reference?)

What directive or assembly reference is required for this.

Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,652 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Arago 5 Reputation points
    2024-04-24T10:55:13.2466667+00:00

    I am using the latest version of the MS Graph client (5.49.0) and .net 8

    0 comments No comments