One note link for opening in app a page

441 Views Asked by At

So, what I would like to do is to programmatically create a link to share with my colleagues in an email message, which allows them to open a OneNote page directly in the App. I was able to figure out that my link is going to be something like:

onenote://base-path ...

but I'm not getting how to build the base-path link, I'm able to have all the necessary page details (I guess) from an API call. can anybody please tell me how to build a link for opening a OneNote page directly in app?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

You can use the GET Pages endpoint in the REST API to retrieve information about a specific page. The response will include a links field which contains a URL that will open that page in the OneNote client (if its available).

Here is an example response:

{
    ...
    "links": {
        "oneNoteClientUrl": {
          "href": "onenote:https:\/\/d.docs.live.net\/73dbaf9b7e5c4b4c\/Documents\/James's%20Notebook\/PCR.one#PCR%20Test%20Page\u00ac\u00dfion-id=3dcda1be-9e78-aa4c-b97d-9cdbe9e5cfab&page-id=57197857-14bc-fd48-b2e7-16c2dbce94ee&end"
        },
        "oneNoteWebUrl": {
          "href": "https:\/\/onedrive.live.com\/redir.aspx?cid=73dbaf9b7e5c4b4c&page=edit&resid=61528580FB755FBB!107&wd=target%28PCR.one%7C3dcda1be-9e78-aa4c-b97d-9cdbe9e5cfab%2FPCR%20Test%20Page%7C57197857-16bc-fd48-b2e7-26c2dbce94ee%2F%29"
        }
      }
     ...
}

This example was taken from: https://dev.onenote.com/docs#/reference/get-pages/v10menotespagesfilterorderbyselectexpandtopskipsearchcount/get

I hope this helps!