OneNote GET sectiongroups

Gets details of section groups to which a user has access.

Last modified: June 25, 2014

Applies to: OneNote service

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

The GET verb with the sectiongroups resource path represents all section groups to which a user has access in all OneNote notebooks that are stored in Microsoft OneDrive. This includes section groups in notebooks that are both owned by and shared with the user. You can also retrieve all section groups to which a user has access inside a specific notebook or section group.

HTTPS://www.onenote.com/api/v1.0/sectiongroups
HTTPS://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectiongroups
HTTPS://www.onenote.com/api/v1.0/sectiongroups/{section group ID}/sectiongroups

Resource information

Protocol

SSL/TLS HTTPS

Response format

JSON

Parameters

$orderby

One or more comma-delimited expressions with an optional ‘asc’ (the default) or ‘desc’ depending on the order you’d like the values sorted. The value of this operator is the list of section group properties to use for sorting the section groups returned by the API and the order in which to sort the results. Valid properties are lastModifiedTime, createdTime, and name. These values are case-sensitive. The default value is name asc (ascending by name). The modifiedTime property refers to the date and time when a page in the section group was last modified. You can specify a list of properties, such as $orderby=name asc, lastModifiedTime desc (ascending by name and descending by lastModifiedTime). The order in which you list the properties will determine the level at which each sort occurs. If you specify a property more than once, only the first instance of the property will be used.

$orderby=name asc

$filter

A Boolean expression for whether a particular entry should be included in the response.

$filter=contains(name, ‘text’)

$select

Limit the properties on each entry in the response to the ones that are specified by this value.

$select=id,name

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, section groups, and pages. Request this scope if your product needs to query section groups 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 section groups that the user created through your product.

office.onenote_update

Grants full access to the user's notebooks, section groups, and pages. Request this scope if your product needs to query and update section groups 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 /sectiongroups endpoint, the OneNote API returns the section groups as JSON objects that conform to the OData version 4.0 specification.

[GET] https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectiongroups

This returns the section groups to which the user has access within a specific notebook. Default ordering is by name asc (case insensitive).

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

This returns the section groups inside a specific section group.

[GET] https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectiongroups?$select=id,name,createdTime&$orderby=createdTime

This returns only the id, title and createdTime properties for the section groups in a specific notebook, ordered by createdTime.

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

sectionsUrl

The /sections endpoint where you can get details for all the sections in the section group.

string

sectionGroupsUrl

The /sectiongroups endpoint where you can get details for all the section groups in the section group.

string

self

The endpoint where you can get details about the section group.

string

id

The unique identifier of the section group.

string

name

The name of the section group.

string

createdBy

The user who created the section group.

string

createdTime

The date and time when the section group was created.

An ISO 8601 formatted date.

lastModifiedBy

The user who last modified the section group.

string

lastModifiedTime

The date and time when the section group was last modified.

An ISO 8601 formatted date.

Content-Type: application/json
X-CorrelationId: <GUID>
Status: 200 OK
{
  "@odata.context":"https://edog.onenote.com/api/Beta/$metadata#sectionGroups","value":[
    {
      "sectionsUrl":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID/sections",
"sectionGroupsUrl":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID/sectionGroups",
"id":"section group ID",
"name":"section group name",
"self":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID",
"createdBy":"user name",
"lastModifiedBy":"user name",
"createdTime":"2013-10-05T16:48:53.553Z",
"lastModifiedTime":"2014-01-13T00:53:18.007Z"
    },
    {
      "sectionsUrl":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID/sections",
"sectionGroupsUrl":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID/sectionGroups",
"id":"section group ID",
"name":"section group name",
"self":"https://www.onenote.com/api/v1.0/sectionGroups/section group ID",
"createdBy":"user name",
"lastModifiedBy":"user name",
"createdTime":"2011-07-20T03:54:50.33Z",
"lastModifiedTime":"2014-06-04T22:23:07.303Z"
    }
  ]
}

Show: