1

When we get the page content as HTML using one note API Image sources doesn't seem to be working correctly. There is a $value at the end of the image source in HTML content. How do we handle this when the one note page has images?
Ex:

img width="649" height="587" src="https://www.onenote.com/api/v1.0/me/notes/resources/0-7dcd564dd9c2472c82451536349be691!1-AA1F36752D8FDBF!14716/$value" data-src-type="image/png" data-fullres-src="https://www.onenote.com/api/v1.0/me/notes/resources/0-7dcd564dd9c2472c82451536349be691!1-AA1F36752D8FDBF!14716/$value" data-fullres-src-type="image/png" />>

zangw
  • 43,869
  • 19
  • 177
  • 214

2 Answers2

3

Have you tried issuing a GET request to that URL (e.g. https://www.onenote.com/api/v1.0/me/notes/resources/0-7dcd564dd9c2472c82451536349be691!1-AA1F36752D8FDBF!14716/$value)? Don't forget to include the Authentication headers.

Jorge Aguirre
  • 2,787
  • 3
  • 20
  • 27
  • Hi Jorge, Thanks for quick response. Don't we have any other way instead of placing a second get request for img SRC? If there is page with 10 image that I wish to display in the app should we parse the html content then look for image source and then fire a new get request to get image? – Karthick Pk Feb 20 '16 at 00:04
  • 1
    I'm afraid with the current state of the API, that is the only possibility. This uservoice item (vote it and tweet to us if you want this feature!) is related. https://onenote.uservoice.com/forums/245490-onenote-developer-apis/suggestions/7916235-ability-to-get-pre-auth-d-image-urls-from-a-onenot – Jorge Aguirre Feb 20 '16 at 04:05
  • This is now a possibility! See Linda's answer. – Jorge Aguirre Mar 23 '16 at 00:25
2

Issue a GET request with the following format:

https://www.onenote.com/api/v1.0/me/notes/pages/*yourpageID*/content?preAuthenticated=true

Essentially, you just pass in the standard query with the argument preAuthenticated=true.

Diode Dan
  • 4,801
  • 6
  • 25
  • 34