0

I am working on OneNote API where I want to update a specific task. But I didn't find any way/API to do that.

Here is what I go to so far using graph API

graph API

I need to update/replace the whole div which isn't the use case. I might have other text there. Any help would be appreciated.

Manzurul Hoque Rumi
  • 2,911
  • 4
  • 20
  • 43
  • I don't think the body of your PATCH request is correct. If you want to update a particular div you will need to replace the entire contents. So 'action':'replace' makes sense but 'position':'after' doesn't. If you have other text inside the div you must include that in the new content as well. – codeye Nov 06 '22 at 13:36
  • What would be the best solution? – Manzurul Hoque Rumi Nov 07 '22 at 13:35
  • It looks like you want to append your content to a current div. I guess you retrieve the target div with includeIDs=true and then take the current contents and add your new content before replacing the entire div. – codeye Nov 08 '22 at 11:08
  • I got it working. – Manzurul Hoque Rumi Nov 08 '22 at 11:42

1 Answers1

0

I had position in the patch request payload which should not have.

enter image description here

After removing postion it's working for a single task to make it completed or uncompleted and even change the text of the task.

Manzurul Hoque Rumi
  • 2,911
  • 4
  • 20
  • 43