获取页面Get page

命名空间:microsoft.graphNamespace: microsoft.graph

检索 page 对象的属性和关系。Retrieve the properties and relationships of a page object.

获取页面信息Getting page information

按页面标识符访问页面的元数据:Access a page's metadata by page identifier:

GET /me/onenote/pages/{id}

获取页面内容Getting page content

您可以使用页面的 content 终结点获取页面的 HTML 内容:You can use the page's content endpoint to get the HTML content of a page:

GET /me/onenote/pages/{id}/content[?includeIDs=true]
GET /me/onenote/pages/{id}/$value[?includeIDs=true]

includeIDs=true查询选项用于更新页面The includeIDs=true query option is used to update pages.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) 请参阅 "注意,"、"注释"、"全部"、"全部"、"写"Notes.Read, Notes.ReadWrite, Notes.Read.All, Notes.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 注意: Read、Notes。读写Notes.Read, Notes.ReadWrite
应用程序Application Notes.Read.All、Notes.ReadWrite.AllNotes.Read.All, Notes.ReadWrite.All

HTTP 请求HTTP request

GET /me/onenote/pages/{id}
GET /users/{id | userPrincipalName}/onenote/pages/{id}
GET /groups/{id}/onenote/pages/{id}
GET /sites/{id}/onenote/pages/{id}

可选的查询参数Optional query parameters

此方法支持 selectexpand OData 查询参数 来帮助自定义响应。This method supports the select and expand OData Query Parameters to help customize the response.

默认响应将展开 parentSection 并选择节的 idnameself 属性。The default response expands parentSection and selects the section's id, name, and self properties. expand页面的有效值为 parentNotebookparentSectionValid expand values for pages are parentNotebook and parentSection.

请求标头Request headers

名称Name 类型Type 说明Description
AuthorizationAuthorization stringstring Bearer {token}。必需。Bearer {token}. Required.
接受Accept stringstring application/json

请求正文Request body

请勿提供此方法的请求正文。Do not supply a request body for this method.

响应Response

如果成功,此方法 200 OK 在响应正文中返回响应代码和 page 对象。If successful, this method returns a 200 OK response code and the page object in the response body.

示例Example

请求Request

下面是一个请求示例。Here is an example of the request.

GET https://graph.microsoft.com/v1.0/me/onenote/pages/{id}
响应Response

下面是一个响应示例。Here is an example of the response. 注意:为简洁起见,此处显示的响应对象将被截断。Note: The response object shown here is truncated for brevity. 将从实际调用中返回所有属性。All of the properties will be returned from an actual call.

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

{
  "title": "title-value",
  "createdByAppId": "createdByAppId-value",
  "links": {
    "oneNoteClientUrl": {
      "href": "href-value"
    },
    "oneNoteWebUrl": {
      "href": "href-value"
    }
  },
  "contentUrl": "contentUrl-value",
  "content": "content-value",
  "lastModifiedDateTime": "2016-10-19T10:37:00Z"
}