want to use the Graph API to create a folder in a user's mailbox that exists in Exchange Online. As a result of the investigation, if I use "https://graph.microsoft.com/v1.0/users/[email protected]/mailFolders", I feel that it is possible, but an error is displayed and I cannot create it. Currently, "Exchange> Mail.ReadWrite, MailboxSettings.ReadWrite" is assigned to the execution user (admin). However, it says "Access is denied. Check credentials and try again." Is the permission wrong? Or is the specified URL incorrect? Sorry to trouble you, but thank you for your response.
【Append】
$body = @{
grant_type="client_credentials"
resource=$resource
client_id=$ClientID
client_secret=$ClientSecret
}
`#Get Token
$oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$TenantName/oauth2/token -Body $body






API permissionsof your app registration, and how did you get the access token and call the api?