How to add file attachment in the mailbody when I send meeting invitation to some one (API:https://graph.microsoft.com/v1.0/me/events)

rajasekhar gogineni 6 Reputation points
2021-07-08T04:47:25.177+00:00

API:https://graph.microsoft.com/v1.0/me/events
Request Body:{
"subject": "My event",
"start": {
"dateTime": "2021-07-08T04:46:05.073Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2021-07-15T04:46:05.073Z",
"timeZone": "UTC"
}
}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JosephXu-MSFT 531 Reputation points
    2021-07-09T02:29:30.137+00:00

    It is not supported to create an event along with attachments within a single request, only we can post an attachment to the event after it's created.

    We can use the following API to add an attachment to an existing event.

       POST /me/events/{eventid}/attachments  
         
       {  
         "@odata.type": "#microsoft.graph.fileAttachment",  
         "name": "$(fileName)",  
         "contentBytes": "$(base64EncodedString)"  
       }  
    
    0 comments No comments