I am trying to create online meeting using below code and passing all the details of app registration. Still its returning 404 error.
static string[] scopes = new string[] { "https://graph.microsoft.com/.default" };
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder.Create(LaiAppClientID).WithClientSecret(Secret).WithRedirectUri(redirectURI).Build();
AuthorizationCodeProvider authProvider = new AuthorizationCodeProvider(app, scopesssss);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
graphClient = new GraphServiceClient("https://graph.microsoft.com/beta",
new DelegateAuthenticationProvider(
async (requestMessage) =>
{
var token = await app.AcquireTokenForClient(scopesssss).WithAuthority(String.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/token", tenantID), true).ExecuteAsync();
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("bearer", token.AccessToken);
}));
var onlineMeeting = new OnlineMeeting
{
StartDateTime = DateTimeOffset.Parse("2021-07-12T21:30:34.2444915+00:00"),
EndDateTime = DateTimeOffset.Parse("2021-07-12T22:00:34.2464912+00:00"),
Subject = "My First MS Teams Meeting",
AudioConferencing= audioConferencing
};
var task = Task.Run(async () =>
{
return await graphClient.Me.OnlineMeetings.Request().AddAsync(onlineMeeting);
});
var d = task.Result;