title | description | ms.date | ms.topic | ms.localizationpriority |
---|---|---|---|---|
OneNote JavaScript API requirement sets |
Learn more about the OneNote JavaScript API requirement sets. |
09/28/2022 |
overview |
high |
Requirement sets are named groups of API members. Office Add-ins use requirement sets specified in the manifest or use a runtime check to determine whether an Office application supports APIs that an add-in needs. For more information, see Office versions and requirement sets.
The following table lists the OneNote requirement sets, the supported Office client applications, and the minimum builds or versions for those applications where applicable.
Requirement set | Office on the web |
---|---|
OneNoteApi 1.1 | Supported |
OneNote JavaScript API 1.1 is the first version of the API. For details about the API, see the OneNote JavaScript API programming overview.
At runtime, add-ins can check if a particular Office application supports an API requirement set by doing the following:
if (Office.context.requirements.isSetSupported('OneNoteApi', '1.1')) {
// Perform actions.
}
else {
// Provide alternate flow/logic.
}
Use the Requirements
element in the add-in manifest to specify critical requirement sets or API members that your add-in must use. If the Office application or platform doesn't support the requirement sets or API members specified in the Requirements
element, the add-in won't run in that application or platform, and won't display in My Add-ins.
The following code example shows an add-in that loads in all Office client applications that support the OneNoteApi requirement set, version 1.1.
<Requirements>
<Sets DefaultMinVersion="1.1">
<Set Name="OneNoteApi" MinVersion="1.1"/>
</Sets>
</Requirements>
For information about Common API requirement sets, see Office Common API requirement sets.