3
votes

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?

3

3 Answers

0
votes

According to the OneNote API (https://docs.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

0
votes

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://docs.microsoft.com/en-us/graph/onenote-update-page#supported-elements-and-actions

-1
votes

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