3

I am replacing a table content in a OneNote Page by using the PATCH API. In order to do so, I call content API with includeIds option.

Following is an example URL.

https://graph.microsoft.com/v1.0/groups/<id>/onenote/pages/<page-id>/content?includeIds=true

If the table has some images the response of the get with ids looks like this

<img id="img:{cdbee0cc-a1d6-4a42-93f8-e4ff7babab92}{28}" width="480" height="147" src="https://graph.microsoft.com/v1.0/groups('id')/onenote/resources/<page-id>/$value" data-src-type="image/png" data-fullres-src="https://graph.microsoft.com/v1.0/groups('id')/onenote/resources/<page-id>/$value" data-fullres-src-type="image/png" />

After the content returns I modify the part of the table and do a PATCH request.

After the PATCH the image is replaced with a cross sign. Because the URL that is returned is a secure URL and As per the OneNote API the images that we can insert/replace should be either public resources or embedded.

In my case want to keep the the original image with in the table I only want to replace other parts of the table. Is there any work around to solve this problem?

Deepak Sharma
  • 1,873
  • 10
  • 23

3 Answers3

0

According to the OneNote API (https://learn.microsoft.com/en-us/graph/onenote-update-page#supported-elements-and-actions) you cannot. You can only update image within a div, but you want to update img within a table

Glenn
  • 1
  • 1
0

As per this documentation, update actions within a table cell are not supported. One more implication of updating elements within a table using PATCH request is that it may mess up with the table structure.

https://learn.microsoft.com/en-us/graph/onenote-update-page#supported-elements-and-actions

  • In answer to the original question if you append preAuthenticated=true to your request you get a link to the image that can be used to patch the table without losing the image data. Patch requests are supported for certain elements, not tr and td but you have the option of updating the entire table. – codeye Oct 25 '20 at 10:48
-1

When you make you Graph request, you should be able to go to Response Headers>client-request-id. Can you please provide the id that you see there, as well as the time/date that you made the request? Please make sure the time/date is within the past 2 weeks.

Thank you

  • This is not really an answer to the author's question. Consider using comments on the question to ask the author for more detail about his/her problem. – giuseppedeponte Oct 19 '19 at 04:47