編輯

共用方式為


notebook: getNotebookFromWebUrl

Namespace: microsoft.graph

Retrieve the properties and relationships of a notebook object by using its URL path.

The location can be user notebooks on Microsoft 365, group notebooks, or SharePoint site-hosted team notebooks on Microsoft 365.

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) Not supported. Not supported.
Application Notes.Read.All Notes.ReadWrite.All

HTTP request

POST /me/onenote/notebooks/GetNotebookFromWebUrl
POST /users/{id | userPrincipalName}/onenote/notebooks/GetNotebookFromWebUrl
POST /groups/{id}/onenote/notebooks/GetNotebookFromWebUrl
POST /sites/{id}/onenote/notebooks/GetNotebookFromWebUrl

Request headers

Name Type Description
Authorization string Bearer {token}. Required. Learn more about authentication and authorization.
Accept string application/json

Request body

In the request body, supply a JSON representation of the full URL path to the notebook you want to retrieve.

Property Type Description
webUrl String The URL path of the notebook to retrieve. It can also contain a "onenote:" prefix.

Response

If successful, this method returns a 200 OK response code and a notebook object in the response body.

Example

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/me/onenote/notebooks/GetNotebookFromWebUrl
Content-type: application/json

{"webUrl":"webUrl value"}
Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal
Content-Length: 544

{
    "isDefault": true,
    "userRole": "userRole-value",
    "isShared": true,
    "sectionsUrl": "sectionUrl-value",
    "sectionGroupsUrl": "sectionGroupUrl-value",
    "links": {
        "oneNoteClientUrl": {
            "href": "href-value"
        },
        "oneNoteWebUrl": {
            "href": "href-value"
        }
    },
    "id": "id-value",
    "self": "self-value",
}