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] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': '@odata.context'})

The OData context.

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

This section created by name.

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

This section created time.

is_default class-attribute instance-attribute
is_default: Optional[bool] = dataclass_field(default=None, kw_only=True, 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] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'lastModifiedBy'})

Last modified by name.

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

The time this section was last modified.

links: Optional[Dict[str, Any]] = dataclass_field(default=None, kw_only=True)

OneNote client links.

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True)

The name of the section.

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

The url of the pages.

self class-attribute instance-attribute
self: Optional[str] = dataclass_field(default=None, kw_only=True)

The url to create section in notebook group.

Page dataclass

Page(*, title: Optional[str] = None, links: Optional[Link | Mapping[str, Any]] = 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] = dataclass_field(default=None, kw_only=True)

The title of the page.

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

A url to the page content.

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

The last modified date of the page.

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

The date the page was created.

id class-attribute instance-attribute
id: Optional[str] = dataclass_field(default=None, kw_only=True)

The unique identifier of the page.

GetPagesInSectionResponse dataclass

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

Response for Get pages for a specific section

Attributes

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

The OData context.

value class-attribute instance-attribute
value: Optional[List[Dict[str, Any]]] = dataclass_field(default=None, kw_only=True)

value

next_link: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': '@odata.nextLink'})

The URL to retrieve the next page.

Notebook dataclass

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

Response for Get recent notebooks

GetSectionsInNotebookResponse dataclass

GetSectionsInNotebookResponse(*, value: Optional[List[SectionListItem | Mapping[str, Any]]] = None)

Response for Get sections in notebook

NewSectionResponse dataclass

NewSectionResponse(*, value: Optional[List[SectionResponse | Mapping[str, Any]]] = None)

Response for When a new section is created

Attributes

value class-attribute instance-attribute
value: Optional[List[SectionResponse | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)

An array of objects, each representing a specific section.

NewSectionGroupResponse dataclass

NewSectionGroupResponse(*, value: Optional[List[SectionGroupResponse | Mapping[str, Any]]] = None)

Response for When a new section group is created

Attributes

value class-attribute instance-attribute
value: Optional[List[SectionGroupResponse | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)

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

NewPageResponse dataclass

NewPageResponse(*, value: Optional[List[Page | Mapping[str, Any]]] = None)

Response for When a new page is created in a section

Attributes

value class-attribute instance-attribute
value: Optional[List[Page | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)

An array of objects, each representing a specific page.

CreateSectionRequest dataclass

CreateSectionRequest(name: str)

Definition: CreateSectionRequest

Attributes

name instance-attribute
name: str

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] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': '@odata.context'})

The OData context.

value class-attribute instance-attribute
value: Optional[List[Dict[str, Any]]] = dataclass_field(default=None, kw_only=True)

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] = dataclass_field(default=None, kw_only=True)

The unique identifier of the parent notebook.

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True)

The name of the parent notebook.

self class-attribute instance-attribute
self: Optional[str] = dataclass_field(default=None, kw_only=True)

A url link to the parent notebook.

Link(one_note_client_url: OneNoteClientUrl | Mapping[str, Any], one_note_web_url: OneNoteWebUrl | Mapping[str, Any])

Definition: Link

OneNoteClientUrl dataclass

OneNoteClientUrl(href: str)

Definition: OneNoteClientUrl

Attributes

href instance-attribute
href: str

A link to the notebook using the OneNote windows client.

OneNoteWebUrl dataclass

OneNoteWebUrl(href: str)

Definition: OneNoteWebUrl

Attributes

href instance-attribute
href: str

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] = dataclass_field(default=None, kw_only=True)

The name of the section.

pages_url class-attribute instance-attribute
pages_url: Optional[str] = dataclass_field(default=None, kw_only=True, 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] = dataclass_field(default=None, kw_only=True)

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 | Mapping[str, Any]] = None, self: Optional[str] = None)

Definition: SectionResponse

Attributes

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

The creator of the section.

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

The creation date and time of the section.

id class-attribute instance-attribute
id: Optional[str] = dataclass_field(default=None, kw_only=True)

Unique identifier of the section.

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

Indicates whether it is the default section.

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

The user who last modified the section.

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

The last modified date and time of the section.

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True)

The name of the section.

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

Url to the pages in this section.

self class-attribute instance-attribute
self: Optional[str] = dataclass_field(default=None, kw_only=True)

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] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'createdTime'})

The creation date and time of the section group.

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

The creator of the section group.

id class-attribute instance-attribute
id: Optional[str] = dataclass_field(default=None, kw_only=True)

Unique identifier of the section group.

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

The user who last modified the section group.

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

The last modification date and time of the section group.

name class-attribute instance-attribute
name: Optional[str] = dataclass_field(default=None, kw_only=True)

The name of the section group.

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

Url of the sections within this section group.

self class-attribute instance-attribute
self: Optional[str] = dataclass_field(default=None, kw_only=True)

The url to this section group.

OnenoteClient

OnenoteClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)

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
credential AsyncTokenCredential | AzureKeyCredential

Caller-owned Azure Core credential.

required
max_retry_attempts int

The maximum number of request attempts.

3
timeout float

The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines.

30.0
use_exponential_backoff bool

Whether retries use exponential backoff.

True
initial_retry_delay_seconds float

The initial retry delay in seconds.

0.5
maximum_retry_delay_seconds float

The maximum retry delay in seconds.

120.0
retry_jitter_factor float

The jitter fraction applied to retry delays.

0.1
retry_unsafe_http_methods bool

Whether unsafe HTTP methods may be retried.

False
transport Optional[AsyncHttpTransport]

Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle.

None
**kwargs Any

Optional Azure Core pipeline policy settings.

{}

Methods:

create_section_in_notebook async
create_section_in_notebook(input: CreateSectionRequest | Mapping[str, Any], notebook_key: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Create section in a notebook

Create section in a notebook.

Swagger operation ID: CreateSectionInNotebook.

Parameters:

Name Type Description Default
input CreateSectionRequest | Mapping[str, Any]

The request body. Mapping keys use serialized Swagger wire names.

required
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

create_page_in_section async
create_page_in_section(input: CreatePageInSectionInput, notebook_key: str, section_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Create page in a section

Create new page in a specified section.

Swagger operation ID: CreatePageInSection.

Parameters:

Name Type Description Default
input CreatePageInSectionInput

The request body.

required
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
section_id str

API URL of the section pages.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

list_pages_in_section
list_pages_in_section(notebook_key: str, section_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]

Get pages for a specific section

Get pages for a specific section.

Returns an Azure Core async pager that follows the connector continuation URL.

Swagger operation ID: GetPagesInSection.

Parameters:

Name Type Description Default
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
section_id str

API URL of the section pages.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
AsyncItemPaged[dict[str, Any]]

AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector results. Consume it with async for.

Raises:

Type Description
ConnectorException

If the connector request fails.

create_page_in_quick_notes async
create_page_in_quick_notes(input: CreatePageInQuickNotesInput, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Create a page in Quick Notes

Create a new page in the Quick Notes section.

Swagger operation ID: CreatePageInQuickNotes.

Parameters:

Name Type Description Default
input CreatePageInQuickNotesInput

The request body.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

delete_page async
delete_page(notebook_key: str, section_id: str, page_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> None

Delete a page

Delete a page.

Swagger operation ID: DeletePage.

Parameters:

Name Type Description Default
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
section_id str

API URL of the section pages.

required
page_id str

Unique id of the page.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Name Type Description
None None

The operation completes without a response body.

Raises:

Type Description
ConnectorException

If the connector request fails.

get_page_content async
get_page_content(notebook_key: str, section_id: str, page_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Get page content

Get HTML page content.

Swagger operation ID: GetPageContent.

Parameters:

Name Type Description Default
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
section_id str

API URL of the section pages.

required
page_id str

Unique id of the page.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

update_page_content async
update_page_content(input: UpdatePageContentRequest, notebook_key: str, section_id: str, page_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None

Update page content

Update HTML page content.

Swagger operation ID: UpdatePageContent.

Parameters:

Name Type Description Default
input UpdatePageContentRequest

The request body.

required
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
section_id str

API URL of the section pages.

required
page_id str

Unique id of the page.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
dict[str, Any] | None

dict[str, Any] | None: The connector operation result.

Raises:

Type Description
ConnectorException

If the connector request fails.

list_notebooks
list_notebooks(*, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]

Get recent notebooks

Get recent notebooks.

Returns a single-page Azure Core async collection.

Swagger operation ID: GetNotebooks.

Parameters:

Name Type Description Default
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
AsyncItemPaged[dict[str, Any]]

AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector results. Consume it with async for.

Raises:

Type Description
ConnectorException

If the connector request fails.

list_sections_in_notebook
list_sections_in_notebook(notebook_key: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]

Get sections in notebook

Get sections in a specific notebook.

Returns a single-page Azure Core async collection.

Swagger operation ID: GetSectionsInNotebook.

Parameters:

Name Type Description Default
notebook_key str

A key identifying the notebook. Note this is specific to the API and cannot be hand-typed.

required
timeout Optional[float]

The request timeout in seconds.

None
headers Optional[Mapping[str, str]]

Additional HTTP request headers.

None
client_request_id Optional[str]

A caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

A callback invoked with the connector response.

None

Returns:

Type Description
AsyncItemPaged[dict[str, Any]]

AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector results. Consume it with async for.

Raises:

Type Description
ConnectorException

If the connector request fails.