Skip to content

OnenoteClient

Attributes

CreatePageInSectionInput module-attribute

CreatePageInSectionInput = str

CreatePageInQuickNotesInput module-attribute

CreatePageInQuickNotesInput = str

UpdatePageContentRequest module-attribute

UpdatePageContentRequest = List[Dict[str, Any]]

TRIGGER_OPERATIONS module-attribute

TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnNewSectionInNotebook': {'operation_id': 'OnNewSectionInNotebook', 'path': '/{connectionId}/trigger1/notebooks/notebookKey/sections', 'method': 'get', 'required_parameters': ['notebookKey'], 'callback_payload_type': 'NewSectionResponse'}, 'OnNewSectionGroupInNotebook': {'operation_id': 'OnNewSectionGroupInNotebook', 'path': '/{connectionId}/trigger2/notebooks/notebookKey/sectiongroups', 'method': 'get', 'required_parameters': ['notebookKey'], 'callback_payload_type': 'NewSectionGroupResponse'}, 'OnNewPageInSection': {'operation_id': 'OnNewPageInSection', 'path': '/{connectionId}/trigger3/sections/Dynamic/pages', 'method': 'get', 'required_parameters': ['notebookKey', 'sectionId'], 'callback_payload_type': 'NewPageResponse'}}

Classes

CreateSectionInNotebookResponse dataclass

CreateSectionInNotebookResponse(context: Optional[str] = None, created_by: Optional[str] = None, created_time: Optional[str] = None, id: Optional[str] = None, is_default: Optional[bool] = None, last_modified_by: Optional[str] = None, last_modified_time: Optional[str] = None, links: Optional[Dict[str, Any]] = None, name: Optional[str] = None, pages_url: Optional[str] = None, self: Optional[str] = None)

Response for Create section in a notebook

Attributes

context class-attribute instance-attribute
context: Optional[str] = field(default=None, metadata={'wire_name': '@odata.context'})

The OData context.

created_by class-attribute instance-attribute
created_by: Optional[str] = field(default=None, metadata={'wire_name': 'createdBy'})

This section created by name.

created_time class-attribute instance-attribute
created_time: Optional[str] = field(default=None, metadata={'wire_name': 'createdTime'})

This section created time.

is_default class-attribute instance-attribute
is_default: Optional[bool] = field(default=None, metadata={'wire_name': 'isDefault'})

A flag to indication if this is the default section.

last_modified_by class-attribute instance-attribute
last_modified_by: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedBy'})

Last modified by name.

last_modified_time class-attribute instance-attribute
last_modified_time: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedTime'})

The time this section was last modified.

links: Optional[Dict[str, Any]] = None

OneNote client links.

name class-attribute instance-attribute
name: Optional[str] = None

The name of the section.

pages_url class-attribute instance-attribute
pages_url: Optional[str] = field(default=None, metadata={'wire_name': 'pagesUrl'})

The url of the pages.

self class-attribute instance-attribute
self: Optional[str] = None

The url to create section in notebook group.

Page dataclass

Page(title: Optional[str] = None, links: Optional[Link] = None, content_url: Optional[str] = None, last_modified_time: Optional[str] = None, created_time: Optional[str] = None, id: Optional[str] = None)

Response for Create page in a section

Attributes

title class-attribute instance-attribute
title: Optional[str] = None

The title of the page.

content_url class-attribute instance-attribute
content_url: Optional[str] = field(default=None, metadata={'wire_name': 'contentUrl'})

A url to the page content.

last_modified_time class-attribute instance-attribute
last_modified_time: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedTime'})

The last modified date of the page.

created_time class-attribute instance-attribute
created_time: Optional[str] = field(default=None, metadata={'wire_name': 'createdTime'})

The date the page was created.

id class-attribute instance-attribute
id: Optional[str] = None

The unique identifier of the page.

GetPagesInSectionResponse dataclass

GetPagesInSectionResponse(context: Optional[str] = None, value: Optional[List[Dict[str, Any]]] = None)

Response for Get pages for a specific section

Attributes

context class-attribute instance-attribute
context: Optional[str] = field(default=None, metadata={'wire_name': '@odata.context'})

The OData context.

value class-attribute instance-attribute
value: Optional[List[Dict[str, Any]]] = None

value

Notebook dataclass

Notebook(file_name: Optional[str] = None, key: Optional[str] = None)

Response for Get recent notebooks

GetSectionsInNotebookResponse dataclass

GetSectionsInNotebookResponse(value: Optional[List[SectionListItem]] = None)

Response for Get sections in notebook

NewSectionResponse dataclass

NewSectionResponse(value: Optional[List[SectionResponse]] = None)

Response for When a new section is created

Attributes

value class-attribute instance-attribute
value: Optional[List[SectionResponse]] = None

An array of objects, each representing a specific section.

NewSectionGroupResponse dataclass

NewSectionGroupResponse(value: Optional[List[SectionGroupResponse]] = None)

Response for When a new section group is created

Attributes

value class-attribute instance-attribute
value: Optional[List[SectionGroupResponse]] = None

An array of objects, each representing a specific section group.

NewPageResponse dataclass

NewPageResponse(value: Optional[List[Page]] = None)

Response for When a new page is created in a section

Attributes

value class-attribute instance-attribute
value: Optional[List[Page]] = None

An array of objects, each representing a specific page.

CreateSectionRequest dataclass

CreateSectionRequest(name: Optional[str] = None)

Definition: CreateSectionRequest

Attributes

name class-attribute instance-attribute
name: Optional[str] = None

The name of the new section.

GetPageResponse dataclass

GetPageResponse(context: Optional[str] = None, value: Optional[List[Dict[str, Any]]] = None)

Definition: GetPageResponse

Attributes

context class-attribute instance-attribute
context: Optional[str] = field(default=None, metadata={'wire_name': '@odata.context'})

The OData context.

value class-attribute instance-attribute
value: Optional[List[Dict[str, Any]]] = None

This page response value.

ParentNotebook dataclass

ParentNotebook(id: Optional[str] = None, name: Optional[str] = None, self: Optional[str] = None)

Definition: ParentNotebook

Attributes

id class-attribute instance-attribute
id: Optional[str] = None

The unique identifier of the parent notebook.

name class-attribute instance-attribute
name: Optional[str] = None

The name of the parent notebook.

self class-attribute instance-attribute
self: Optional[str] = None

A url link to the parent notebook.

Link(one_note_client_url: Optional[OneNoteClientUrl] = None, one_note_web_url: Optional[OneNoteWebUrl] = None)

Definition: Link

OneNoteClientUrl dataclass

OneNoteClientUrl(href: Optional[str] = None)

Definition: OneNoteClientUrl

Attributes

href class-attribute instance-attribute
href: Optional[str] = None

A link to the notebook using the OneNote windows client.

OneNoteWebUrl dataclass

OneNoteWebUrl(href: Optional[str] = None)

Definition: OneNoteWebUrl

Attributes

href class-attribute instance-attribute
href: Optional[str] = None

A link to the notebook using the OneNote web client.

SectionListItem dataclass

SectionListItem(name: Optional[str] = None, pages_url: Optional[str] = None, id: Optional[str] = None)

Definition: SectionListItem

Attributes

name class-attribute instance-attribute
name: Optional[str] = None

The name of the section.

pages_url class-attribute instance-attribute
pages_url: Optional[str] = field(default=None, metadata={'wire_name': 'pagesUrl'})

The key used to reference this section; also a url to the pages.

id class-attribute instance-attribute
id: Optional[str] = None

Unique identifier of the section.

SectionResponse dataclass

SectionResponse(created_by: Optional[str] = None, created_time: Optional[str] = None, id: Optional[str] = None, is_default: Optional[bool] = None, last_modified_by: Optional[str] = None, last_modified_time: Optional[str] = None, name: Optional[str] = None, pages_url: Optional[str] = None, parent_notebook: Optional[ParentNotebook] = None, self: Optional[str] = None)

Definition: SectionResponse

Attributes

created_by class-attribute instance-attribute
created_by: Optional[str] = field(default=None, metadata={'wire_name': 'createdBy'})

The creator of the section.

created_time class-attribute instance-attribute
created_time: Optional[str] = field(default=None, metadata={'wire_name': 'createdTime'})

The creation date and time of the section.

id class-attribute instance-attribute
id: Optional[str] = None

Unique identifier of the section.

is_default class-attribute instance-attribute
is_default: Optional[bool] = field(default=None, metadata={'wire_name': 'isDefault'})

Indicates whether it is the default section.

last_modified_by class-attribute instance-attribute
last_modified_by: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedBy'})

The user who last modified the section.

last_modified_time class-attribute instance-attribute
last_modified_time: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedTime'})

The last modified date and time of the section.

name class-attribute instance-attribute
name: Optional[str] = None

The name of the section.

pages_url class-attribute instance-attribute
pages_url: Optional[str] = field(default=None, metadata={'wire_name': 'pagesUrl'})

Url to the pages in this section.

self class-attribute instance-attribute
self: Optional[str] = None

The url to this section.

SectionGroupResponse dataclass

SectionGroupResponse(created_time: Optional[str] = None, created_by: Optional[str] = None, id: Optional[str] = None, last_modified_by: Optional[str] = None, last_modified_time: Optional[str] = None, name: Optional[str] = None, sections_url: Optional[str] = None, self: Optional[str] = None)

Definition: SectionGroupResponse

Attributes

created_time class-attribute instance-attribute
created_time: Optional[str] = field(default=None, metadata={'wire_name': 'createdTime'})

The creation date and time of the section group.

created_by class-attribute instance-attribute
created_by: Optional[str] = field(default=None, metadata={'wire_name': 'createdBy'})

The creator of the section group.

id class-attribute instance-attribute
id: Optional[str] = None

Unique identifier of the section group.

last_modified_by class-attribute instance-attribute
last_modified_by: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedBy'})

The user who last modified the section group.

last_modified_time class-attribute instance-attribute
last_modified_time: Optional[str] = field(default=None, metadata={'wire_name': 'lastModifiedTime'})

The last modification date and time of the section group.

name class-attribute instance-attribute
name: Optional[str] = None

The name of the section group.

sections_url class-attribute instance-attribute
sections_url: Optional[str] = field(default=None, metadata={'wire_name': 'sectionsUrl'})

Url of the sections within this section group.

self class-attribute instance-attribute
self: Optional[str] = None

The url to this section group.

OnenoteClient

OnenoteClient(connection_runtime_url: str, token_provider: Optional[TokenProvider] = None, options: Optional[ConnectorClientOptions] = None)

Bases: ConnectorClientBase

Typed client for onenote connector.

Initialize a OnenoteClient.

Parameters:

Name Type Description Default
connection_runtime_url str

The connection runtime URL from Azure Portal.

required
token_provider Optional[TokenProvider]

Optional token provider. Defaults to ManagedIdentityTokenProvider.

None
options Optional[ConnectorClientOptions]

Optional connector client options.

None

Methods:

create_section_in_notebook_async async
create_section_in_notebook_async(input: CreateSectionRequest, notebook_key: str) -> dict[str, Any] | None

Create section in a notebook

Create section in a notebook.

create_page_in_section_async async
create_page_in_section_async(input: CreatePageInSectionInput, notebook_key: str, section_id: str) -> dict[str, Any] | None

Create page in a section

Create new page in a specified section.

get_pages_in_section_async async
get_pages_in_section_async(notebook_key: str, section_id: str) -> dict[str, Any] | None

Get pages for a specific section

Get pages for a specific section.

create_page_in_quick_notes_async async
create_page_in_quick_notes_async(input: CreatePageInQuickNotesInput) -> dict[str, Any] | None

Create a page in Quick Notes

Create a new page in the Quick Notes section.

delete_page_async async
delete_page_async(notebook_key: str, section_id: str, page_id: str) -> None

Delete a page

Delete a page.

get_page_content_async async
get_page_content_async(notebook_key: str, section_id: str, page_id: str) -> dict[str, Any] | None

Get page content

Get HTML page content.

update_page_content_async async
update_page_content_async(input: UpdatePageContentRequest, notebook_key: str, section_id: str, page_id: str) -> dict[str, Any] | None

Update page content

Update HTML page content.

get_notebooks_async async
get_notebooks_async() -> dict[str, Any] | None

Get recent notebooks

Get recent notebooks.

get_sections_in_notebook_async async
get_sections_in_notebook_async(notebook_key: str) -> dict[str, Any] | None

Get sections in notebook

Get sections in a specific notebook.