Notion API page doesn't Update even if REST query has 200 response

Hi,
I've been able to make the integration with Notion by following the documentation. The connection with Notion DB works and I can query it, but when I use the endpoint to update a page, I receive a 200 response status, but the data passed is not updated.

Someone has been able to do that?

this is the endpoint I'm using
image

and the Raw object I'm passing:
{
"properties": {
"Brief Description": {
"rich_text": {
"type": "text",
"text": {
"content": {{textInput3.value}},
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": {{textInput3.value}},
"href": null
}
}
}
}

The API request looks like this

"request": {
"url": "https://api.notion.com/v1/pages/db882a74-dc51-4fe8-8d8c-5bba74725895",
"method": "PATCH",
"body": "{"properties":{"Brief Description":{"rich_text":{"type":"text","text":{"content":"Developer and provider of drive-through management services for the restaurant industry. The company offers outdoor digital signage and drive-through technology for the quick service restaurants and fast casual brands which helps in digital menu display as well as order confirmation system.","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Developer and provider of drive-through management services for the restaurant industry. The company offers outdoor digital signage and drive-through technology for the quick service restaurants and fast casual brands which helps in digital menu display as well as order confirmation system.","href":null}}}}",
"headers": {
"User-Agent": "Retool/2.0 (+https://docs.tryretool.com/docs/apis)",
"Authorization": "Bearer secret_-----------------------------------------------",
"Notion-Version": "2022-06-28",
"ot-baggage-requestId": "undefined",
"x-datadog-trace-id": "9022145048778787038",
"x-datadog-parent-id": "7845193382335967378",
"x-datadog-sampling-priority": "2",
"traceparent": "00-00000000000000007d35191ed88248de-6cdfb9d0cc617092-01",
"tracestate": "dd=s:2",
"X-Retool-Forwarded-For": "87.4.34.93"
}
}

Hey Alessio! Have you tried different body types aside from Raw? Does the Notion API specifically ask for Raw? And if you run this same request from Postman, does it work for you?

Hi Victoria! Thank you for the suggestion! I've changed from RAW to JSON and it works! (I've put properties as the key name and the rest of the Json object as the value)

Actually there is another issue that is not clearly specified in the Notion docs: rich-text has to be passed as an array, even if there is only one element inside, so it needs square brackets like this:

{
"properties": {
"Brief Description": {
"rich_text": [{
"type": "text",
"text": {
"content": "Developer and provider of drive-through management services for the restaurant industry. The company offers outdoor digital signage and drive-through technology for the quick service restaurants and fast casual brands which helps in digital menu display as well as order confirmation system.",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Developer and provider of drive-through management services for the restaurant industry. The company offers outdoor digital signage and drive-through technology for the quick service restaurants and fast casual brands which helps in digital menu display as well as order confirmation system.",
"href": null
}]
}
}
}

1 Like