編輯

共用方式為


notebook: getRecentNotebooks

Namespace: microsoft.graph

Get a list of recentNotebook instances that have been accessed by the signed-in user.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Notes.Create Notes.Read, Notes.Read.All, Notes.ReadWrite, Notes.ReadWrite.All
Delegated (personal Microsoft account) Notes.Create Notes.Read, Notes.ReadWrite
Application Notes.Read.All Notes.ReadWrite.All

HTTP request

GET /me/onenote/notebooks/getRecentNotebooks(includePersonalNotebooks={includePersonalNotebooks})
GET /users/{id | userPrincipalName}/onenote/notebooks/getRecentNotebooks(includePersonalNotebooks={includePersonalNotebooks})

The {id | userPrincipalName} for the user must match the user encoded in the authorization token used to make the request.

Function parameters

Parameter Type Description
includePersonalNotebooks Boolean Include notebooks owned by the user. Set to true to include notebooks owned by the user; otherwise, set to false. If you don't include the includePersonalNotebooks parameter, your request returns a 400 error response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

A successful response returns a 200 OK that contains a JSON collection of recentNotebooks.

Example

The following example shows how to call this API.

Request

The following example shows the request.

GET https://graph.microsoft.com/v1.0/me/onenote/notebooks/getRecentNotebooks(includePersonalNotebooks=true)

Response

The following example shows the response.

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

{
  "value":[
    {
      "displayName":"Personal Notebook","lastAccessedTime":"timestamp","links":{
        "oneNoteClientUrl":{
          "href":"onenote:href-value"
        },"oneNoteWebUrl":{
          "href":"href-value"
        }
      },"sourceService":"OneDrive"
    },{
      "displayName":"Team Shared Notebook","lastAccessedTime":"timestamp","links":{
        "oneNoteClientUrl":{
          "href":"onenote:href-value"
        },"oneNoteWebUrl":{
          "href":"href-value"
        }
      },"sourceService":"OneDriveForBusiness"
    }
  ]
}