Search code examples
microsoft-graph-apimicrosoft-graph-calendar

Receiving 400s and 500s when attempting to get singleValueExtendedProperties


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!


Solution

  • 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.