python-o365
python-o365 copied to clipboard
How to schedule a shared event?
Hi @janscas O365 package is really helpful and I have been using it to develop a service where I am trying to schedule a shared event but from the readme I have been able to find scheduler for personal events only. I am sharing the code that I am referring for personal events.
from datetime import datetime as dt
# necessary imports and credentials
credentials = (CLIENT_ID, SECRET_ID)
protocol = MSGraphProtocol()
protocol = MSGraphProtocol(defualt_resource='<[email protected]>')
scopes = ['Calendars.Read.Shared','Calendars.ReadWrite.Shared']
account = Account(credentials, protocol=protocol)
if account.authenticate(scopes=scopes):
print('Authenticated!')
schedule = account.schedule()
calendar = schedule.get_default_calendar()
new_event = calendar.new_event()
new_event.subject = 'Test Event'
new_event.location = 'No location'
new_event.start = dt(2022, 6, 6, 16, 45)
new_event.start = dt(2022, 6, 6, 17, 0)
new_event.remind_before_minutes = 15
new_event.save()
Can you help me understanding how can I schedule shared events on Outlook via 0365. Thanks 😊
I don't really know... Take a look at the MS Graph docs and try to find something about shared events. If it's in MS Graph it's possible to implement in O365.
Thanks
Thanks! If I am stuck in anything else, will query back here :)
did you find a way @bhav09 ?