Graph API - Unable to create calendar event for the user

Comfy McComfy 26 Reputation points
2022-10-14T08:43:22.303+00:00

Creating calendar event for the user using graph API returns error. It doesn't happen for all the users, some specific users faces this issue. The users have valid O365 license and were able to create calendar event successfully earlier. Suddenly, graph API started returning the below error response during calendar event creation.

API - https://graph.microsoft.com/v1.0/users/<user email address>/events
Method - Post request

Error - The property ‘originalStartTimeZone' does not exist on type 'Microsoft.OutlookServices.Event'. Make sure to only use property names that are defined by the type or mark the type as open type. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com/

If there is any existing documentation on the possible errors and its resolution, kindly provide me the link. Thanks

Update: Removed some keys removed from request payload - originalStartTimeZone (UTC), originalEndTimeZone (UTC), reminderMinutesBeforeStart (15), isOrganizer (True), showAs (busy), type (SingleInstance). Getting error on 'start' key of the request data

Error: The property 'start' does not exist on type 'Microsoft.OutlookServices.Event'. Make sure to only use property names that are defined by the type or mark the type as open type. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Comfy McComfy 26 Reputation points
    2022-10-14T13:19:15.797+00:00

    @HarmeetSingh7172 I tried updating the payload information but getting error on 'start' key but it is required as part of the document you shared. The property 'start' does not exist on type 'Microsoft.OutlookServices.Event'. Make sure to only use property names that are defined by the type or mark the type as open type. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com

    Keys removed from payload - originalStartTimeZone (UTC), originalEndTimeZone (UTC), reminderMinutesBeforeStart (15), isOrganizer (True), showAs (busy), type (SingleInstance). I didn't understand how the keys works for some users where as it gives error for different users.

    Ref: https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0

    Please find below the request data used for event creation which gives error on start key

    ----------

    requestData = {
    "start": {"dateTime": start, "timeZone": start.tzname()},
    "location": {
    "displayName": <room resource>,
    "locationEmailAddress": <room resource>,
    },
    "end": {"dateTime": end, "timeZone": end.tzname()},
    "attendees": [
    {"type": "required", "emailAddress": {"address": attendee}}
    ],
    "organizer": {"emailAddress": {"address": organizer}},
    "subject": title,
    }

    ----------

    1 person found this answer helpful.
    0 comments No comments

  2. HarmeetSingh7172 4,826 Reputation points
    2022-10-14T11:18:02.48+00:00

    Hi @Comfy McComfy

    Thanks for reaching out!

    As per the error message you're getting in API response, it seems you are using 'originalStartTimeZone' property in request body of POST /users/{id | userPrincipalName}/events. Please note that, the 'originalStartTimeZone' property is a response property for Create Events API.

    For creating an event, you need to use start dateTime and timeZone property in request body. Below is the sample payload request:

    {  
      "subject": "Let's go for lunch",  
      "body": {  
        "contentType": "HTML",  
        "content": "Does noon work for you?"  
      },  
      "start": {  
          "dateTime": "2017-04-15T12:00:00",  
          "timeZone": "Pacific Standard Time"  
      },  
      "end": {  
          "dateTime": "2017-04-15T14:00:00",  
          "timeZone": "Pacific Standard Time"  
      },  
      "location":{  
          "displayName":"Harry's Bar"  
      },  
      "attendees": [  
        {  
          "emailAddress": {  
            "address":"******@contoso.onmicrosoft.com",  
            "name": "Samantha Booth"  
          },  
          "type": "required"  
        }  
      ],  
      "allowNewTimeProposals": true,  
      "transactionId":"7E163156-7762-4BEB-A1C6-729EA81755A7"  
    }  
    

    References:
    Create Event-Graph API
    Events-Graph API

    Hope this helps!

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.