Hi @Gleitze Ramos ,
You would need to use the below Microsoft Graph Calendar API to create the events with "Calendars.ReadWrite" graph API application permissions granted to your app in Azure AD. Please make sure to mention /users and then followed by User ID or userPrincipalName in the API as mentioned below. Also, I have tested it and the events are created for other non-admin users or general users with the below mentioned API & sample JSON payload (as shown in the below screenshot) and you can also verify the same.
Also, regarding your requirement , you would have to register an application (i.e, a background service or daemon that run on a server without the presence of a signed-in user) in Azure AD. This app can call Microsoft Graph with their own identity use the OAuth 2.0 client credentials grant flow to get access tokens from Azure AD. You can refer documentation for more details information on Authentication and authorization steps.
POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events
POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/calendar/events
POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/calendars/{id}/events
Example :
POST https://graph.microsoft.com/v1.0/users/******@o365XXX.onmicrosoft.com/events
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2022-03-25T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2022-03-25T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address": "******@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
}
**Example Output in Postman : An event is created in non-admin/general user's calendar ** :
You can refer the below documentation on create events using Microsoft Graph Calendar API :
https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any further questions about this answer, please click "Comment".