2
votes

I'm building an application, which will need to send requests to Microsoft Graph, and create events in Office 365 Calendar.

I'm using events endpoint:

'users /' + graphdata ['userPrincipalName'] + '/ events'

There's no problems when I create events for the account accessing the app.

But I would like to, as ADMIN, grant permission to create these events in the calendar of other users.

I have look in the documentation for some permissions, among the admin permissions, that would allow me to do this, but I did not find anything.

Does anyone know of any way to do this in Microsoft Graph?

I initially believed that the endpoint users / '+ graphdata [' userPrincipalName '] +' / events allowed this because one of the parameters is the username of the email account.

The error I get when I try to use this endpoit with another user is: 404: ErrorItemNotFound - The specified object was not found in this store.

1

1 Answers

4
votes

When you're authenticated as a user you are using Delegated scopes and you only have access to their mailbox (and any shared with them).

If you want to create events on calendars on any account, you need to use the Client Credentials OAuth grant and Application scopes. This process is documented under Get access without a user.