2

trying to add extended properties to calendar objects. I am able to create calendars with the following payload (Ruby syntax, payload is sent as a JSON):

name: build_calendar_name,
singleValueExtendedProperties: [{
  id: "String {#{SecureRandom.uuid}} Name setting_id",
  value: @setting_id.to_s
}]

I receive a 201 from this request and the calendar is created no problem

The frustrating part is I cannot retrieve the extended property when making a GET request. The following two requests should work:

GET /me/events/calendar_id?$expand=singleValueExtendedProperties($filter=id eq 'String {guuid} Name setting_id')

Response
{
    "error": {
        "code": "BadRequest",
        "message": "Parsing OData Select and Expand failed: Found an unbalanced bracket expression.",
        "innerError": {
            "date": "2020-07-01T22:38:14",
            "request-id": "<hidden>"
        }
    }
}
GET /me/calendars?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String {guuid} Name setting_id' and ep/value eq 'setting_id')

Response:
{
    "error": {
        "code": "ErrorInternalServerError",
        "message": "An internal server error occurred. The operation failed.",
        "innerError": {
            "date": "2020-07-01T22:40:15",
            "request-id": "<hidden>"
        }
    }
}

Guuid, calendar_id and setting_id are dummy values, real values are used when attempting these calls.

We've also tried following the examples verbatim at this link https://learn.microsoft.com/en-us/graph/api/singlevaluelegacyextendedproperty-get?view=graph-rest-1.0&tabs=http#example and still receive these response codes. Would love some help with this. Thanks!

crice1988
  • 81
  • 1
  • 10
  • Are you setting this on a calendar, or on an event? Your first request is retrieving an event, but your payload in the first example looks like a calendar. Also, have you tried this in Graph Explorer to rule out your Ruby code? – Jason Johnston Jul 02 '20 at 14:55
  • Crap. Sorry for the confusion, that should've been calendar. And yes, these responses are from the Graph Explorer. – crice1988 Jul 02 '20 at 17:08

1 Answers1

6

I reproduced this for the $expand case in Graph Explorer. The problem seems to be the = inside the parentheses. If you URL-encode that to %3D the query works fine.

$expand=singleValueExtendedProperties($filter%3Did eq 'String {guuid} Name setting_id')

For the $filter, I reproduce it when doing GET /me/calendars, but not when doing GET /me/events. This seems to be a problem with the service (unless the docs are just wrong). Let me check and report back.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34