Search code examples
onenoteonenote-api

onenote snapshot intranet webpage


Is it possible to take a webpage snapshot of a non-public facing website (intranet) using the OneNote API?

I'm using the OneNote API to create OneNote notebooks, pages and sections. It's working well. Unfortunately, when I use data-render-src and point it to an intranet website, it fails to take a snapshot. The application is on the same intranet as the website I wish to capture.

Example HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>A page with an image: Webpage capture zzzz</title>
    <meta name="created" value="2015-11-11T12:45:00.000-8:00"/>
  </head>
  <body>
    <p>This page displays an image of the webpage.</p>
    <img data-render-src="https://intranet.website.com" width="800"/>
  </body>
</html>

Note: I can take snapshots of publicly accessible websites.

Webpage snapshot description https://learn.microsoft.com/en-us/graph/onenote-images-files#add-a-webpage-snapshot

Image rendered from html description https://learn.microsoft.com/en-us/graph/onenote-images-files#add-an-image-rendered-from-html


Solution

  • I don't think it is - the OneNote aPI server will not have access to that page because it isn't public. You'll have to extract the HTML and send it over through the API instead of using data-render-src.