OneNote GET sections/id

Gets details of a specified section.

Last modified: July 07, 2014

Applies to: apps for SharePoint | OneNote service | SharePoint Server 2013

In this article
Resource URLs
HTTP Request Headers
OAuth scopes
Extended description
Example request
HTTP response headers
Response properties
Example response
Additional resources

The GET verb with the sections/{section id} resource path represents a specific section inside a OneNote notebook that is stored in Microsoft OneDrive. This can be a section in a notebook that is either owned by or shared with the user.

HTTPS://www.onenote.com/api/v1.0/sections/{section ID}

Resource information

Protocol

SSL/TLS HTTPS

Response format

JSON

All requests to the OneNote API must include the Authorization header.

Request Header

Value and Description

Authorization

Bearer tokenString
A valid OAuth token provided to the app based on the user credentials and the user having authorized access. For more information, see Authenticate the user for the OneNote API.

Security note Security Note

The Microsoft OneNote API requires OAUTH authentication, so user names and passwords passed in clear text, as is done with Basic authentication, are not accepted. To ensure the security of your user's account credentials, be sure your app doesn't attempt to use Basic authentication, or send account credentials, even when it's over HTTPS.

Request one of the following scopes when your product authenticates the user, depending on what you want the user to be able to see.

Scopes

Scope

Purpose

office.onenote

Grants read permissions to the user's notebooks and pages. Request this scope if your product needs to query sections in any of the user's notebooks.

office.onenote_update_by_app

Grants create, read, update, and delete permissions to pages created by the product. Request this scope if your product only needs to query sections that the user created through your product.

office.onenote_update

Grants full access to the user's notebooks, sections, and pages. Request this scope if your product needs to query and update sections in any of the user's notebooks.

office.onenote_create

Allows your product to enumerate the notebook hierarchy and create pages in any location. Request this scope if your product needs to create pages in any of the user's notebooks.

When you use the GET verb with the /sections/id endpoint, the OneNote API returns the section as a JSON object that conforms to the OData version 4.0 specification.

[GET] https://www.onenote.com/api/v1.0/sections/{section ID}

This returns the specified section, if the user has access to it. You can get a list of sections by using the sections resource path. If the user or your application doesn’t have correct permissions to get access to the section, the OneNote API will return an error code in the 40001-49999 range.

Response Header

Value and Description

Content-Type

Application/json: charset=utf-8

The API always returns data in JSON format.

X-CorrelationId

<GUID>

The correlation ID uniquely identifies the request and can be used when debugging problems.

Property

Value and description

Value type

isDefault

Indicates whether this is the user’s default section.

Boolean

pagesUrl

The /pages endpoint where you can create new pages in the section. Use the POST verb with this endpoint to create new pages inside the section.

string

self

The endpoint where you can get details about the section.

string

id

The unique identifier of the section.

string

name

The name of the section.

string

createdBy

The user who created the section.

string

createdTime

The date and time when the section was created.

An ISO 8601 formatted date.

lastModifiedBy

The user who last modified the section.

string

lastModifiedTime

The date and time when the section was last modified.

An ISO 8601 formatted date.

Content-Type: application/json
X-CorrelationId: <GUID>
Status: 200 OK
{
  "@odata.context":"https://www.onenote.com/api/v1.0/$metadata#sections","value":[
    {
      "isDefault":false,
"pagesUrl":"https://www.onenote.com/api/v1.0/sections/section ID/pages",
"id":"section ID",
"name":"section name",
"self":"https://www.onenote.com/api/v1.0/sections/section ID",
"createdBy":"user name",
"lastModifiedBy":"user name",
"createdTime":"2013-10-05T10:58:19.98Z",
"lastModifiedTime":"2013-10-13T10:42:36.11Z"
    }
  ]
}

Show: