Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit e2889b9

Browse files
committed
POST section under sg support
1 parent 71c92cc commit e2889b9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.5",
2+
"version": "2.0.6",
33
"name": "onenoteapi",
44
"description": "JavaScript library to make calling the OneNote API easier.",
55
"main": "target/oneNoteApi.js",

src/scripts/iOneNoteApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface IOneNoteApi {
1212
getPages(options: { top?: number, sectionId?: string }): Promise<ResponsePackage<any>>;
1313
updatePage(pageId: string, revisions: Revision[]): Promise<ResponsePackage<any>>;
1414
createSection(notebookId: string, name: string): Promise<ResponsePackage<any>>;
15+
createSectionUnderSectionGroup(sectionGroupId: string, name: string): Promise<ResponsePackage<any>>;
1516
getNotebooks(excludeReadOnlyNotebooks?: boolean): Promise<ResponsePackage<any>>;
1617
getNotebooksWithExpandedSections(expands?: number, excludeReadOnlyNotebooks?: boolean): Promise<ResponsePackage<any>>;
1718
getNotebookByName(name: string): Promise<ResponsePackage<any>>;

src/scripts/oneNoteApi.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ export class OneNoteApi extends OneNoteApiBase implements IOneNoteApi {
127127
return this.requestPromise("/me/notes/notebooks/" + notebookId + "/sections/", data);
128128
}
129129

130+
/**
131+
* CreateSectionUnderSectionGroup
132+
*/
133+
public createSectionUnderSectionGroup(sectionGroupId: string, name: string): Promise<ResponsePackage<any>> {
134+
let obj: Object = { name: name };
135+
let data = JSON.stringify(obj);
136+
137+
return this.requestPromise("/me/notes/sectionGroups/" + sectionGroupId + "/sections/", data);
138+
}
139+
130140
/**
131141
* GetNotebooks
132142
*/

0 commit comments

Comments
 (0)