1
votes

OneNote tags on page elements (e.g. <p>) show up in the HTML content returned via the REST API prefixed with a data-tag=attribute. But if the complete note is tagged, that tag doesn't seem to show up in the returned content.

Or am I missing something?

[EDIT] Here's a screenshot showing the complete note tagged as 'Important' (star symbol) : enter image description here

I can't see anything in the returned content that relates to that tag:

<html lang="en-US">
    <head>
        <title>Didi Chuxing = Jean Liu</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
        <div style="position:absolute;left:48px;top:67px;width:576px">
            <img width="480" height="270" src="https://www.onenote.com/api/v1.0/me/notes/[...]
            <br />
            <p lang="en-NZ" style="font-size:14pt;margin-top:0pt;margin-bottom:0pt">credit : Fast Company</p>
        </div>
    </body>
</html>

[EDIT] This question has led to a UserVoice request for this feature to be added in to the API. Only one vote so far - maybe this mention will get it more ;)

1
Can you elaborate on what you mean by "the complete note"? Maybe a screenshot?Jorge Aguirre
@JorgeAguirre Thanks for your prompt reponse! I've attached a screenshot showing the tag on the complete note and the returned HTML not showing it.Velojet
It is clear now, thanks for the explanation.Jorge Aguirre

1 Answers

1
votes

The note-tag you are showing is in the title of the page.

Currently, the OneNote API does not support returning note tags in the title. This is different to note-tags in the body, because the title tag is returned in our API as part of the HTML->head->title - other note-tags are returned within the HTML->body. I believe the right way of representing this information is to add the data-tag attribute to the HTML->head->title element.

I suggest creating a UserVoice item for this feature.

https://onenote.uservoice.com/forums/245490-onenote-developer-apis