A cloud-based identity and access management service for securing user authentication and resource access
Hi,
You cannot use the Graph REST API to create multiple events at once, for this you need to use batching.
This is explained here: https://learn.microsoft.com/en-us/graph/json-batching
So you should call the following endpoint:
POST https://graph.microsoft.com/v1.0/$batch Content-type: application/json
For your example the body would be as follows:
{
"requests": [
{
"id": "1",
"method": "POST",
"url": "/me/calendars/AAMkAGViNDU7zAAAAAGtlAAA=/events",
"body": {
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does mid month work for you?"
},
"start": {
"dateTime": "2019-03-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-03-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address": "******@contoso.onmicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
},
{
"id": "2",
"method": "POST",
"url": "/me/calendars/AAMkAGViNDU7zAAAAAGtlAAA=/events",
"body": {
"subject": "Let's go for lunch 2",
"body": {
"contentType": "HTML",
"content": "Does mid month work for you?"
},
"start": {
"dateTime": "2019-03-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-03-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address": "******@contoso.onmicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
},
{
"id": "3",
"method": "POST",
"url": "/me/calendars/AAMkAGViNDU7zAAAAAGtlAAA=/events",
"body": {
"subject": "Let's go for lunch 3",
"body": {
"contentType": "HTML",
"content": "Does mid month work for you?"
},
"start": {
"dateTime": "2019-03-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-03-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address": "******@contoso.onmicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
}
]
}