You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何限制Microsoft Graph API仅按SharePoint站点名称搜索?

解决方法

要精准筛选名称以Digital_开头的SharePoint站点,不要使用$search(它会跨多个属性检索),而是通过$filter结合startswith函数,指定匹配站点的displayName属性:

  • 请求示例:
    GET https://graph.microsoft.com/v1.0/sites?$filter=startswith(displayName,'Digital_')
    

原因说明

  1. $search参数会同时检索站点的多个属性(如标题、描述、站点路径等),所以会返回非名称匹配的结果。
  2. 你之前尝试的$search="name:Digital_"无效,是因为站点的名称属性实际是displayName,而非name,Graph API中没有name这个站点属性用于筛选。
  3. 使用startswith(displayName,'Digital_')可以精准限定只匹配**站点名称开头为Digital_**的结果。

内容的提问来源于stack exchange,提问作者zmbq

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 15:52:01