question

lemur avatar image
0 Votes"
lemur asked lemur commented

Retrieving InkNode from OneNote using Graph

Hi,
I'd like to extract InkNodes or page contents from OneNote. So far I've been able to successfully make a request to https://graph.microsoft.com/beta/me/onenote/pages/{id}/content. However, most of the notes I'd like to retrieve are written with a Pen, so they're not standard text format.

I'd like to do one of the following:
1. Retrieve and parse the InkNode data from Graph
2. If possible, request ink-written note as .pdf-exported page or a .jpg or simply parsed to text.

Is any of the above possible? If not, are there any plans/roadmap to have such a feature in the future?

Thanks



microsoft-graph-notes
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CarlZhao-MSFT avatar image
1 Vote"
CarlZhao-MSFT answered lemur commented

Hi @lemur

Retrieve and parse the InkNode data from Graph

If you want to retrieve the InkNode content of the OneNote page, can try use includeinkML=true.
/pages/[pageid]/content?includeinkML=true

If possible, request ink-written note as .pdf-exported page or a .jpg or simply parsed to text.

Does not support the use of graph api to export OneNote content to pdf or jpg pages, it can only be exported as HTML. Currently seems that there are no plans/roadmap under implementation. So I suggest you submit a user voice to propose support for this feature, and I will vote for you.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks @CarlZhao-MSFT!
I actually tried this in Microsoft Graph API sandbox and it failed, but when I make a curl request with the same parameters and token I get the proper output. Don't know if this is intended, but got me confused.

One question connected with this though -- in the response I get 2 xmls -- one with the text nodes and the second with the InkNodes. In the first, I still get <!-- InkNode is not supported --> but in the second I have proper InkNodes as I expected. Is there any way to ask the server not to include the first .xml (the one that says InkNode node not supported) and only have the part with the InkNodes?

Cheers!

0 Votes 0 ·

Hi @lemur

I tried it and it seems that it cannot be filtered out in the api request. If this text is in your notes, you can delete it directly.

0 Votes 0 ·

Yes, but you see the problem is that I get the same thing twice, I think.

The response contains in fact 2 .xmls with InkNode, but only second one is parsed, the first one is not and it says InkNode node not supported all the way.
Those notes do not contain any text or data except for the ePen written notes.

Thanks!

0 Votes 0 ·