Is it possible to update calendar event properties together with an open data extension in a single PATCH?

Erik van Paassen 6 Reputation points
2021-02-09T16:00:01.04+00:00

I'm wondering whether it's possible to update properties of an open data extension attached to an event and regular properties of this event in one call, using the Graph API. Hopefully someone can shed some light on this.

The documentation of 'Update event' seems to suggest so:

Because the event resource supports extensions, you can use the PATCH operation to add, update, or delete your own app-specific data in custom properties of an extension in an existing event instance.

However, when I'm sending such a request, the extension is not actually created/updated, while the regular event properties are. The request I'm sending:

Request: PATCH /v1.0/me/events/<EVENT_ID>  

Request body:  

{  
    "id": "<EVENT_ID>",  
    "location": {  
        "displayName": "This is the updated value"  
    },  
    "extensions": [  
        {  
            "@odata.type": "microsoft.graph.openTypeExtension",  
            "extensionName": "my.app.id",  
            "testProp": "test"  
        }  
    ]  
}  

But when I retrieve the event again, the location is updated, but it doesn't contain the extension:

Request: GET /me/events/<EVENT_ID>?$expand=extensions($filter=id eq 'my.app.id')  
  
Response body:  

{  
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('<SOME_ID_HERE>')/events(extensions())/$entity",  
    "id": "<EVENT_ID>",  
      
    ...  
      
    "location": {  
        "displayName": "This is the updated value",  
        "locationType": "default",  
        "uniqueId": "This is the updated value",  
        "uniqueIdType": "private"  
    },  
    "locations": [  
        {  
            "displayName": "This is the updated value",  
            "locationType": "default",  
            "uniqueId": "This is the updated value",  
            "uniqueIdType": "private"  
        }  
    ],  
      
    ...  
}  

I thought the old, deprecated Outlook REST API also supported this, but I can't seem to get it to work with the Graph API.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,494 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Deva-MSFT 2,266 Reputation points Microsoft Employee
    2021-02-12T14:17:41.44+00:00

    If i am not wrong, you need to first store the item in the store, then make the changes - its the recommended approach. Being said that let me check on this and see if its doable or not.


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.