【问题标题】:Get extended properties in office 365 graph delta API在 Office 365 图形增量 API 中获取扩展属性
【发布时间】:2018-08-06 07:34:33
【问题描述】:

我们正在构建一个使用图形 API 集成 Office 365 的应用程序。我们需要将所有 Office 365 联系人拉入我们的系统,并且需要保持同步。 办公室中有delta API,仅用于提取增量更改。发现无法拉取扩展属性的问题(包括手机、助理电话等 Outlook MPAI 字段)

GET https://graph.microsoft.com/v1.0/me/contacts/delta

所以 Office 365 是否希望客户端进行额外的 API 调用以获取每个联系人的扩展属性? 意思是如果用户有 1000 个联系人,客户端必须进行 1000 多个 API 调用才能从 office365 中提取联系人?

还有另一个联系人搜索 API,它支持单个调用中的扩展属性。我们可以使用它来拉取增量更改吗?

GET https://graph.microsoft.com/v1.0/me/contacts?$filter=lastModifiedDateTime gt  '2018-07-28T05:25:32Z'

请告诉我们如何有效地拉取 office365 联系人

提前致谢!

【问题讨论】:

    标签: odata office365 microsoft-graph-api office365api


    【解决方案1】:

    据我所见(并通过日历事件观察自己)大多数增量查询调用不支持扩展。可选查询参数下的增量查询见doc

    $expand 仅支持用户和组的 managermembers 导航属性。

    增量查询也不支持您的过滤器请求。如果你使用:

    GET https://graph.microsoft.com/v1.0/me/contacts/delta?$filter=lastModifiedDateTime gt  2018-07-28T05:25:32Z
    

    您收到以下错误:

    "error":
    {
        "code": "ErrorInvalidUrlQuery",
        "message": "The following parameters are not supported with change tracking over the 'Contacts' resource: '$orderby, $filter, $select, $expand, $search, $top'.",
        "innerError":
        {
            "request-id": "da1174b3-d...",
            "date": "2018-08-06T12:45:34"
        }
    }
    

    有趣的是,实际上支持选择 (contact delta doc)。 无论如何,您唯一的选择似乎是扩展用户的正常联系请求。 如果有很多变化,你可以试试batching扩展的联系请求。

    【讨论】:

    • 实际上是使用最后修改日期过滤器获取扩展属性。 graph.microsoft.com/v1.0/me/… ge 2018-07-28T05:25:32Z&$expand=singleValueExtendedProperties($filter=id eq 'String 0x3A1E' or id eq 'String 0x3A1F' or id eq 'String 0x3A21' or id eq 'String 0x3A24' or id eq 'String 0x3A25' 或 id eq 'String 0x3A23' 或 id eq 'String 0x3A2E' 或 id eq 'String 0x3A02' 或 id eq 'String 0x3A1D' 或 id eq 'String 0x3A2C' 或 id eq 'String 0x3A4B')跨度>
    • @RamarajKaruppusamy 正确,您需要展开才能获得 singleValueExtendedProperties。我只是想指出,如果您将问题GET https://graph.microsoft.com/v1.0/me/contacts?$filter=lastModifiedDateTime gt '2018-07-28T05:25:32Z“与增量查询结合使用,则不支持您在问题GET https://graph.microsoft.com/v1.0/me/contacts?$filter=lastModifiedDateTime gt '2018-07-28T05:25:32Z 中提供的网址。我的答案的第一部分(事实上$expand 不支持联系人的增量查询) 可能更适合您。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多