OneNote JavaScript API requirement sets
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
OneNote JavaScript API 1.1 is the first version of the API. For details about the API, see the OneNote JavaScript API programming overview.
Runtime requirement support check
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.
}
Manifest-based requirement support check
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>
Office Common API requirement sets
For information about Common API requirement sets, see Office Common API requirement sets.
See also
Office Add-ins