Receiving 400s and 500s when attempting to get singleValueExtendedProperties

帅比萌擦擦* 提交于 2020-07-09 11:48:33

问题


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://docs.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!


回答1:


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.



来源:https://stackoverflow.com/questions/62686415/receiving-400s-and-500s-when-attempting-to-get-singlevalueextendedproperties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!