Skip to content

Instantly share code, notes, and snippets.

@zaverden
Created September 24, 2018 09:54
Show Gist options
  • Save zaverden/18ce26e1c977af51ec870c098594033c to your computer and use it in GitHub Desktop.
Save zaverden/18ce26e1c977af51ec870c098594033c to your computer and use it in GitHub Desktop.
OneNote replace table to complete to-do
<html lang="en-US">
<head>
<title>table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="created" content="2018-09-24T12:29:00.0000000" />
</head>
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div style="position:absolute;left:61px;top:123px;width:624px">
<table style="border:1px solid;border-collapse:collapse">
<tr>
<td style="border:1px solid"><span style="font-weight:bold">Task</span></td>
<td style="border:1px solid"><span style="font-weight:bold">Comment</span></td>
</tr>
<tr>
<td style="border:1px solid"><span data-tag="to-do">Update todo in table</span></td>
<td style="border:1px solid">There are some issues when we updating todos located inside of tables</td>
</tr>
</table>
<br />
</div>
</body>
</html>
<html lang="en-US">
<head>
<title>table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="created" content="2018-09-24T12:29:00.0000000" />
</head>
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div id="div:{cccdc1ad-6925-4822-8005-c23977f0d938}{82}" style="position:absolute;left:61px;top:123px;width:624px">
<table id="table:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{49}" style="border:1px solid;border-collapse:collapse">
<tr id="tr:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{50}">
<td id="td:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{54}" style="border:1px solid"><span style="font-weight:bold">Task</span></td>
<td id="td:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{57}" style="border:1px solid"><span style="font-weight:bold">Comment</span></td>
</tr>
<tr id="tr:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{51}">
<td id="td:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{63}" style="border:1px solid"><span data-tag="to-do">Update todo in table</span></td>
<td id="td:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{66}" style="border:1px solid">There are some issues when we updating todos located inside of tables</td>
</tr>
</table>
<br />
</div>
</body>
</html>
curl --request PATCH \
--url 'https://graph.microsoft.com/beta/me/onenote/pages/1-18ce238b7988450c8bbf5dcb7655c6bb!65-304d54d6-d499-49f0-b231-cb3a9248e4e9/content' \
--header 'authorization: Bearer valid-token-here' \
--header 'content-type: application/json' \
--data '[
{
"action": "replace",
"target": "table:{4f2002ae-3128-4cde-abb4-8fbdc3e61f1c}{49}",
"content": "<table style=\"border:1px solid;border-collapse:collapse\"><tr><td style=\"border:1px solid\"><span style=\"font-weight:bold\">Task</span></td><td style=\"border:1px solid\"><span style=\"font-weight:bold\">Comment</span></td></tr><tr><td style=\"border:1px solid\"><span data-tag=\"to-do:completed\">Update todo in table</span></td><td style=\"border:1px solid\">There are some issues when we updating todos located inside of tables</td></tr></table>"
}
]'
HTTP/1.1 204 No Content
Cache-Control: private
Content-Length: 0
Content-Type: text/plain
request-id: 8d6169b5-7c83-4a4b-8b23-da22b9d3feff
client-request-id: 8d6169b5-7c83-4a4b-8b23-da22b9d3feff
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"4","ScaleUnit":"000","Host":"AGSFE_IN_12","ADSiteName":"WEU"}}
Duration: 9202.4036
Strict-Transport-Security: max-age=31536000
Date: Mon, 24 Sep 2018 09:51:44 GMT
<html lang="en-US">
<head>
<title>table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="created" content="2018-09-24T12:29:00.0000000" />
</head>
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div style="position:absolute;left:61px;top:123px;width:624px">
<table style="border:0px">
<tr>
<td style="border:0px"><span style="font-weight:bold">Task</span></td>
<td style="border:0px"><span style="font-weight:bold">Comment</span></td>
</tr>
<tr>
<td style="border:0px">Update todo in table</td>
<td style="border:0px">There are some issues when we updating todos located inside of tables</td>
</tr>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment