I am using the notion api integration in power automate to create a page in a notion db https://learn.microsoft.com/en-gb/connectors/notionip/#commentresponse. No matter what structure i fill in, in the properties field i get validation errors. Trying to solve the json by following up on the errors i get a conflicting next error. Seeming to think the implementation in Power Automate has a bug in there.
I tried different properties json inputs but keep getting errors. When i try the same json structure to make the call in a simple local python script it does work. Has anybody used the power automate integration recently.
Different calls and error responses, the calls are the content of the properties field in the api call. Insight is the name of the title field in my Notion db.
Call 1
{
"API Key": "my secret",
"Insight": {
"type": "title",
"title": []
}
}
Error message:
{
"object": "error",
"status": 400,
"code": "validation_error",
"message": "body failed validation. Fix one:\nbody.properties.Insight.id should be defined, instead was `undefined`.\nbody.properties.Insight.name should be defined, instead was `undefined`.\nbody.properties.Insight.start should be defined, instead was `undefined`.",
"request_id": "a96925f7-7a5e-4f52-b3e0-6781df749718"
}
Call 2:
{
"API Key": "my secret",
"Insight": {
"id": "title",
"name": "name",
"start": "20240324"
}
}
Error message:
{
"object": "error",
"status": 400,
"code": "validation_error",
"message": "body failed validation. Fix one:\nbody.properties.Insight.start should be not present, instead was `\"20240324\"`.\nbody.properties.Insight.id should be not present, instead was `\"title\"`.\nbody.properties.Insight.name should be not present, instead was `\"name\"`.",
"request_id": "6dd93bca-0aa9-4944-9914-820f06947dcc"
}
Running locally in a python script i did two things. First i retrieved the current pages in the database to get the structure. That looks like
'Insight': {'id': 'title', 'type': 'title', 'title': []}},
Also i tried to make a page, that was without problems. Also different variations of the json were all no problem.
properties = {
"Insight": {
"type": "title",
"title": [
{
"type": "text",
"text": {
"content": "test2"
}
}
]
}}
I used the python functions listed here https://www.python-engineer.com/posts/notion-api-python/