尝试获取 singleValueExtendedProperties 时收到 400s 和 500s [英] Receiving 400s and 500s when attempting to get singleValueExtendedProperties

查看:69
本文介绍了尝试获取 singleValueExtendedProperties 时收到 400s 和 500s的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试向日历对象添加扩展属性.我可以使用以下有效负载(Ruby 语法,有效负载作为 JSON 发送)创建日历:

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
}]

我收到了来自这个请求的 201 并且日历创建没有问题

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

令人沮丧的部分是我在发出 GET 请求时无法检索扩展属性.以下两个请求应该有效:

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 和 setting_id 是虚拟值,尝试这些调用时使用真实值.

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

我们也尝试过在此链接中逐字跟踪示例https://docs.microsoft.com/en-us/graph/api/singlevaluelegacyextendedproperty-get?view=graph-rest-1.0&tabs=http#example 并且仍然收到这些响应代码.希望得到一些帮助.谢谢!

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!

推荐答案

我在 Graph Explorer 中为 $expand 案例复制了这个.问题似乎是括号内的 = .如果您将其 URL 编码为 %3D,则查询工作正常.

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')

对于 $filter,我在执行 GET/me/calendars 时重现它,但在执行 GET/me/events 时不会重现它.这似乎是服务的问题(除非文档是错误的).让我检查并报告.

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.

这篇关于尝试获取 singleValueExtendedProperties 时收到 400s 和 500s的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆