How to get unique identifiers for OneNote pages?

Hi,

We’d like to be able to access the Guid of each Page so that we can identify pages reliably across version upgrades of Aspose Note.

For example, Document has a getGuid method: Document | Aspose.Note for Java API Reference

but we don’t see a similar method for Page: Page | Aspose.Note for Java API Reference

Is there another way we can extract the Guid of a Page?

@nuix

We have logged your requirement with ID “NOTEJAVA-560” for further investigation. You will automatically be informed here once we have more information to share.

@nuix

We have investigated and found that every OneNote file has unique GUID according to specification, but this is not true in the case of Pages. The pages have no any unique GUIDs defined. Howerver, Document.getGuid() method returns the GUID for file.

@MuzammilKhan

Hi,

We have analyzed the Microsoft Graph API for OneNote purpose. When we retrieve page details, graph API is returning a GUID. I’m not sure how they are generating this GUID if it is not available. When i checked their documentation I found that some attributes exist as below for a page node. Is it possible to expose these attributes via API ?

–Srinu

@srinivas.itb,

As we already evaluated and told, every OneNote file has unique guid according to the specifications. But there is no such guid available for Page object. We found Pages have no unique guids in the OneNote document file format.

Could you share more details, sample documents, screenshots and other references on how did you get GUIDs for Page, we will check it soon.

Hi,

Thanks for quick reply. Here is the screenshot for the same. I have tried in Microsoft graph explorer itself. Let me know if you need any further information.

URL:  https://graph.microsoft.com/v1.0/users/f2a823ac-85c8-4aeb-9315-ed2b2cd8f598/onenote/pages/1-6c8d7b5c4fc1413c901f4f089ac28206!14-91372903-7d6c-46a2-b42e-8ea9014ed5fe/content

In the above URL - 1-6c8d7b5c4fc1413c901f4f089ac28206!14-91372903-7d6c-46a2-b42e-8ea9014ed5fe indicates page id. 

{
            **"id": "1-b6256ef3f416475ca3d492c3f9a1325b!45-91372903-7d6c-46a2-b42e-8ea9014ed5fe"**,
            "self": "https://graph.microsoft.com/v1.0/users/f2a823ac-85c8-4aeb-9315-ed2b2cd8f598/onenote/pages/1-b6256ef3f416475ca3d492c3f9a1325b!45-91372903-7d6c-46a2-b42e-8ea9014ed5fe",
            "createdDateTime": "2019-09-17T09:21:15Z",
            "title": "Second Page",
            "createdByAppId": "",
            "contentUrl": "https://graph.microsoft.com/v1.0/users/f2a823ac-85c8-4aeb-9315-ed2b2cd8f598/onenote/pages/1-b6256ef3f416475ca3d492c3f9a1325b!45-91372903-7d6c-46a2-b42e-8ea9014ed5fe/content",
            "lastModifiedDateTime": "2019-09-17T09:21:18Z",
            "links": {
                "oneNoteClientUrl": {
                    "href": "XXXXXX"
                },
                "oneNoteWebUrl": {
                    "href": "XXXXXXX"
                }
            },
            "parentSection@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('f2a823ac-85c8-4aeb-9315-ed2b2cd8f598')/onenote/sections('1-91372903-7d6c-46a2-b42e-8ea9014ed5fe')/pages('1-b6256ef3f416475ca3d492c3f9a1325b%2145-91372903-7d6c-46a2-b42e-8ea9014ed5fe')/parentSection/$entity",
            "parentSection": {
                "id": "1-91372903-7d6c-46a2-b42e-8ea9014ed5fe",
                "displayName": "gerhbe",
                "self": "https://graph.microsoft.com/v1.0/users/f2a823ac-85c8-4aeb-9315-ed2b2cd8f598/onenote/sections/1-91372903-7d6c-46a2-b42e-8ea9014ed5fe"
            }
        }

image.png (29.2 KB)

@srinivas.itb,

Thanks for the screenshot and details.

We evaluated Microsoft Graph API. We found Microsoft Graph API assigns unique GUID to each page and provides API to retrieve this GUID and work via REST API with Page object using this GUID.
When Page object is stored to *.one file, it is also assigned a GUID but Page GUID in Microsoft Graph API has different format than GUID in *.one file, i.e., they are not consistent. Also there is no references mentioned in documentation that GUID values used in Microsoft Graph API are related in some way to GUID values stored in *.one files for the same objects.

We are sorry but at the moment we don’t support Microsoft Graph API and cannot provide GUID appropriate to use within this service.

Hi Amjad,

Thanks for the confirmation.

Is it possible to provide the id attribute as mentioned in the below(in bold),

<jcidPageNode id=“0x0000000A” jcid=“0x0006000B”>
<LastModifiedTime>1/1/2010 1:00:00 PM</LastModifiedTime>
<ElementChildNodesOfPage>
<jcidOutlineNode id=“0x0000000B” jcid=“0x0006000C”>
<LastModifiedTime>1/1/2010 1:00:00 PM</LastModifiedTime>
<ElementChildNodesOfOutline>
<jcidOutlineElementNode id=“0x0000000C” jcid=“0x0006000D”>
<LastModifiedTime>1/1/2010 1:00:00 PM</LastModifiedTime>
<ContentChildNodesOfOutlineElement>
<jcidRichTextOENode id=“0x0000000D” jcid=“0x0006000E”>
<LastModifiedTime>1/1/2010 1:00:00 PM</LastModifiedTime>
<TextRunFormatting>
{0x0000000F, 0x00000010, 0x0000000F}
</TextRunFormatting>
<TextRunIndex>{5, 9}</TextRunIndex>
<ParagraphStyle>0x0000000E</ParagraphStyle>
<TextExtendedAscii>Text with formatting</TextExtendedAscii>
<RichEditTextLangID>0x0409</RichEditTextLangID>
</jcidRichTextOENode>
</ContentChildNodesOfOutlineElement>
<OutlineElementChildLevel>0x01</OutlineElementChildLevel>
<AuthorOriginal>0x00000009</AuthorOriginal>
<AuthorMostRecent>0x00000009</AuthorMostRecent>
<CreationTimeStamp>1/1/2010 12:00:00 PM</CreationTimeStamp>
</jcidOutlineElementNode>
</ElementChildNodesOfOutline>
<OutlineElementChildLevel>0x01</OutlineElementChildLevel>
<LayoutMaxHeightInOutline>0.4</LayoutMaxHeightInOutline>
<RgOutlineIndentDistance>
<count>0x04</count>
<unused>0</unused>
<rgIndents>{0.5, 0.0, 0.8, 0.8}</rgIndents>
</RgOutlineIndentDistance>
<BodyTextAlignment>0</BodyTextAlignment>
<OffsetFromParentHoriz>1.0</OffsetFromParentHoriz>
<OffsetFromParentVert>2.4</OffsetFromParentVert>
</jcidOutlineNode>

@srinivas.itb,

Since we don’t support Microsoft Graph API and cannot provide your desired GUID. Anyways, we will still check/investigate if this (provide the id attribute as mentioned in the below(in bold)) can be feasible enough to be supported.

Once we have any new information, we will share it with you.

@srinivas.itb,

We need details regarding use case of using this new field:

  1. What is the problem you are facing?
  2. Why new field is helpful to solve this problem?

Hi Amjad,

Our application needs to download only the incremental changes of a section rather than downloading entire section file (.one). Based on my understanding(it’s gut feeling) Graph is using this field to identify section or at least this would be unique in the section.

Another thing I observed is, there is no way to export/import a section. It would be great if this is available too.

–Srinu

@srinivas.itb,

Thanks for providing further details.

We will evaluate and get back to you soon.

I afraid that there is no any way to determine the correct section that you want the page to be created in, and you could take a try to create the API URL of the section and enter that into the field.