I'm trying to use MS Graph to modify an event in my (Office 365) Outlook calendar such that it comes to have zero categories. Microsoft's "Update event" document doesn't seem to tell how I can do this.
Context:
I have an event with the "Foo" category already assigned.
Desired State:
For the event to have no category assigned at all.
What Has Worked:
I have successfully added a category to the event by specifying an array with a single string that is the display name of the category, like so:
URI: https://graph.microsoft.com/v1.0/me/calendar/events/<id>
Method: PATCH
Body:
{
"categories": ["Foo"]
}
What Hasn't Worked:
Setting "categories" to either an empty array ([]
) or an array containing a single empty string ([""]
) does not remove the category and does not return any error. Setting "categories" to null
or [null]
returns an error.
How can I modify an event to remove its category?
Using a Patch works okay for me
PATCH https://graph.microsoft.com/v1.0/me/events/AAMk...TTP/1.1
Host: graph.microsoft.com
{"categories":[]}
When you try this what do you see in the response ? are you seeing the categories set back to []. If you do but you don't see the change in the client it may just be related to sync time (eg Outlook in Cache mode etc).
Are you using any of the SDK's to do the update it maybe a bug or issue with those libraries when you have a null or empty value but you need to specify more what SDK or library your using.