Hola!
I think you need to work with Microsoft Graph to achieve what you want. I have tested some its features/functions and sometimes I get lost due to its power and wide options, it’s not for rookies according to my opinion (neither what you wish
)
Microsoft Graph gives you a full REST APIs and client libraries to access data on several Microsoft services: Bookings, Calendar, Excel, Microsoft 365 compliance eDiscovery, Microsoft Search, OneDrive, OneNote, Outlook/Exchange, etc, etc.
More info here: Overview of Microsoft Graph - Microsoft Graph | Microsoft Docs
Saludos