question

KajalNagare-8870 avatar image
0 Votes"
KajalNagare-8870 asked Sheena-MSFT answered

How to add multiple events in outlook using batch and what url should I add in batch ?

Trying to add multiple events using batch but showing error, unable to deserialize content

microsoft-graph-calendarmicrosoft-graph-batching
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @KajalNagare-8870 ,

Through my research on the batch you mentioned, the issue seem to be more related to microsoft graph batching. Please kindly understand that the Outlook tag here we mainly focus on general issues about Outlook desktop client. In order to better solve your problem, I will remove "office-outlook-itpro" tag and add "azure-batch" & "microsoft-graph-batching" tag.

According to my personal research, the following related article is for your reference. Hope to help you.
Combine multiple requests in one HTTP call using JSON batching

Thanks for your understanding and hope your question will be resolved soon!

0 Votes 0 ·

Thank you for your reply.

0 Votes 0 ·

Hello @KajalNagare-8870 would you share the request-id, body and response so we can look into this?

0 Votes 0 ·

1 Answer

Sheena-MSFT avatar image
0 Votes"
Sheena-MSFT answered

Hi @KajalNagare-8870,

To add multiple events in outlook using batching use the following URL and Request Body

 POST https://graph.microsoft.com/v1.0/$batch
 {
     "requests": [
         {
             "id": "1",
             "method": "POST",
             "url": "/me/calendars/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": "adelev@contoso.onmicrosoft.com",
                             "name": "Adele Vance"
                         },
                         "type": "required"
                     }
                 ]
             },
             "headers": {
                 "Content-Type": "application/json"
             }
         },
         {
             "id": "2",
             "method": "POST",
             "url": "/me/calendars/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": "adelev@contoso.onmicrosoft.com",
                             "name": "Adele Vance"
                         },
                         "type": "required"
                     }
                 ]
             },
             "headers": {
                 "Content-Type": "application/json"
             }
         },
         {
             "id": "3",
             "method": "POST",
             "url": "/me/calendars/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": "adelev@contoso.onmicrosoft.com",
                             "name": "Adele Vance"
                         },
                         "type": "required"
                     }
                 ]
             },
             "headers": {
                 "Content-Type": "application/json"
             }
         }
     ]
 }


Note: At a time we can create four events only.

180743-batching.png


Reference:throttling

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.




batching.png (61.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.