I'm in a similar issue as imfloridaguy, I've followed the guide in that initial post and I get
array ( 'code' => 'MailboxNotEnabledForRESTAPI', 'message' => 'The mailbox is either inactive, soft-deleted, or is hosted on-premise.', )
The closest I got in terms of error messages was when I had the Resource Details Endpoint and scopes using graph.microsoft.com:
https://graph.microsoft.com/IMAP.AccessAsUser.All https://graph.microsoft.com/POP.AccessAsUser.All https://graph.microsoft.com/SMTP.Send etc etc, I got the error 'Invalid Email Atrribute' when the default set attribute has been 'EmailAddress' and I have tried mail , email and emailaddress incase of any case sentivity shennaigans.
No such luck, at this point I've created a whole new user/mailbox from scratch and applied a Microsoft365 Business license to ensure mail box was setup by microsoft as a proper user mailbox, any thoughts on this?
Update: I set the email attribute to UserPrincipalName and I now get an error message:
Email Mismatch: Expecting Authorization for mailbox_tester@companyname not admin_user_requiredfor_approval@companyname , I'm being repeatedly asked to admin approve the app, despite it already having such from the intial setup steps in the above provided guide