hi! i’m trying to build a workflow that automatically adds a page in a database when there’s a new event in my google calendar, with the description of the event being the page content of the entry. (i’m aware that there’s the “New Page from Database” action, but i needed to make the title have a hyperlink; for now i’m just adding an append_block
step that updates the page content, but i’d like to know what i’ve done wrong) i tried looking through the notion api docs and copied some of the code, but it’s returning an error.
return await axios($, {
method: `POST`,
url: `https://api.notion.com/v1/pages`,
headers: {
Authorization: `Bearer ${this.notion.$auth.oauth_access_token}`,
"Notion-Version": `2021-08-16`,
},
data: {
parent: {
'database_id': databaseID
},
properties: {
//other properties left out
'children': {
"object": "block",
"paragraph": {
"rich_text": [
{
"text": {
"content": description //this is the description i want to add
}
}
],
"color": "default"
}
}
}
}
})
i’m getting a 400 Bad Request error, here’s what it’s telling me:
body failed validation. Fix one:
body.properties.children.title should be defined, instead wasundefined
.
body.properties.children.rich_text should be defined, instead wasundefined
.
body.properties.children.number should be defined, instead wasundefined
.
body.properties.children.url should be defined, instead wasundefined
.
body.properties.children.select should be defined, instead wasundefined
.
body.properties.children.multi_select should be defined, instead wasundefined
.
body.properties.children.people should be defined, instead wasundefined
.
body.properties.children.email should be defined, instead wasundefined
.
body.properties.children.phone_number should be defined, instead wasundefined
.
body.properties.children.date should be defined, instead wasundefined
.
body.properties.children.checkbox should be defined, instead wasundefined
.
body.properties.children.relation should be defined, instead wasundefined
.
body.properties.children.files should be defined, instead wasundefined
.
body.properties.Name.id should be defined, instead wasundefined
.
body.properties.Name.name should be defined, instead wasundefined
.
body.properties.Name.start should be defined, instead wasundefined
.
i’m not sure why it isn’t accepting the rich_text i tried to add, and i wasn’t able to make a trigger event to see how a block is formatted : (
disclaimer: this is my first forum post anywhere so i apologise if i’ve been unclear or left anything out! (just comment and i’ll do my best to update the post) i’ve also never programmed in javascript before,i got the rest of the step working by copying an image…any help would be tremendously appreciated!