getRestApiId()

Gets the ID that is compatible with the REST API.

Syntax

pageObject.getRestApiId();

Parameters

None

Returns

string

Examples

OneNote.run(function(ctx){
// Get the current page.
var page = ctx.application.getActivePage();
var restApiId = page.getRestApiId();
return ctx.sync().
then(function(){
console.log("The REST API ID is " + restApiId.value);
// Note that the REST API ID isn't all you need to interact with the OneNote REST API. For SharePoint notebooks, the notebook baseUrl should be used to talk to the OneNote REST API according to [OneNote Development Blog](https://blogs.msdn.microsoft.com/onenotedev/2015/06/11/and-sharepoint-makes-three/)
// (this is only required for SharePoint notebooks, baseUrl will be null for OneDrive notebooks)
});
});

insertPageAsSibling(location: string, title: string)

Inserts a new page before or after the current page.

Syntax

pageObject.insertPageAsSibling(location, title);

Parameters

Parameter

Type

Description

location

string

The location of the new page relative to the current page. Possible values are: Before, After