python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

How to schedule a shared event?

Open bhav09 opened this issue 2 years ago • 3 comments

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 😊

bhav09 avatar Jun 06 '22 10:06 bhav09

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

alejcas avatar Jun 07 '22 08:06 alejcas

Thanks! If I am stuck in anything else, will query back here :)

bhav09 avatar Jun 07 '22 08:06 bhav09

did you find a way @bhav09 ?

yeyeric avatar Jan 06 '23 19:01 yeyeric