获取资源Get resource

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

检索文件或图像 资源 对象的二进制数据。Retrieve the binary data of a file or image resource object.

权限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/resources/{id}/content
GET /users/{id | userPrincipalName}/onenote/resources/{id}/content
GET /groups/{id}/onenote/resources/{id}/content
GET /sites/{id}/onenote/resources/{id}/content

请求标头Request headers

名称Name 类型Type 说明Description
AuthorizationAuthorization stringstring Bearer {token}。必需。Bearer {token}. Required.

请求正文Request body

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

响应Response

如果成功,此方法 200 OK 在响应正文中返回响应代码和图像或文件二进制数据。If successful, this method returns a 200 OK response code and the image or file binary data in the response body.

注意:图像不会直接在浏览器中呈现,因为它们需要授权才能检索它们,如页面内容的其余部分。Note: Images won't render directly in a browser because they require authorization to retrieve them, like the rest of the page content.

示例Example

请求Request

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

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

下面是一个响应示例。Here is an example of the response.

HTTP/1.1 200 OK
Content-Type: application/octet-stream

...binary data...