Search code examples
office365apioffice-addinsoffice365-appsonenoteonenote-api

OneNote page exist but resource link from OneNote API is expired


I'm build OneNote add-in and I need some export feature.

From my search, I found only I could use is OneNote API with preAuthenticate param.

It gave me html content and I confirmed it rendered properly with images within in browser. But after a few mins, resource links giving below error and I have to re-fetch content html with above API.

{
   @api.url: "http://aka.ms/onenote-errors#C20130",
   code: "20130",
   message: "No HTTP resource was found that matches the request URI Resource not found, perhaps the public link has expired. Try a new public page content call.."
}

So, my question is

  1. Is there any way to get html content of OneNote page without resource expiration?
  2. Is there any add-in or OneNote API to export OneNote page as pdf file?

Thanks in advance!


Solution

    1. No - you'd have to download the image, upload it somewhere else, and reference it from there
    2. Unfortunately, also no. We only expose HTML, so you'd need to convert the HTML returned to PDF