使用 Microsoft 搜索 API 搜索书签

可以使用 Microsoft Graph 中的 Microsoft 搜索 API 搜索书签。 管理员可以在Microsoft 365 管理中心或通过创建书签 API 创建书签

警告

测试版中的搜索 API 架构已更改。 搜索请求和响应中的某些属性已重命名或删除。 有关详细信息,请参阅 架构更改弃用警告。 本主题中的示例显示了最新的架构。

创建书签后,若要搜索书签,请在 searchRequestentityTypes 属性中将 指定 bookmark 为 值。

示例:搜索书签

请求

POST https://graph.microsoft.com/v1.0/search/query
Content-Type: application/json

{
  "requests": [
    {
      "entityTypes": [
        "bookmark"
      ],
      "query": {
        "queryString":"Yammer"
      }
    }
  ]
}

响应

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#search",
  "value": [
  {
   "@odata.type": "#microsoft.graph.searchResponse",
   "hitsContainers": [
    {
     "@odata.type": "#microsoft.graph.searchHitsContainer",
     "hits": [
      {
       "@odata.type": "#microsoft.graph.searchHit",
       "hitId": "a9f59c69-f4a1-42ac-820e-0f35114300f8",
       "rank": 1,
       "resource": {
          "@odata.type": "#microsoft.graph.search.bookmark",
          "id": "a9f59c69-f4a1-42ac-820e-0f35114300f8",
          "displayName": "Yammer",
          "description": "Yammer is a collaboration tool that helps you connect and engage across the company. Start conversations, share knowledge, and build communities.",
          "webUrl": "https://www.yammer.com/office365",
        }
       }
      }
     ],
     "total": 1,
     "moreResultsAvailable": false
    }
   ]
  }
 ]
}

已知问题

  • 书签搜索不支持排序、聚合和分页。
  • 不支持将非应答实体类型组合搜索 (例如 driveItemlist) 。 仅支持与其他答案实体类型 书签qna首字母缩略词 的组合搜索。

后续步骤