My objective is create a shortcut to add new page within a database, a children inside the parente database, in another words.
I read the notion docs and made some tests using Postman and worked well.
The cURL used by Postman:
curl --location --request POST 'https://api.notion.com/v1/pages/'
--header 'Content-Type: application/json'
--header 'Notion-Version: 2022-06-28'
--header 'Authorization: Bearer secret_t2RrUto5r8cHnaRIyFO8DkXxKC5HXaz4P2WsoFgYUlF'
--data-raw '{
"parent": {
"database_id": "d584dbac-c8b0-4f0a-9166-f6f516eabd4c"
},
"properties": {
"Category": {
"select": {
"name": "Inbox"
}
},
"Title": {
"title": [
{
"text": {
"content": "New Page with content from API"
}
}
]
}
},
"children": [
{
"object": "block",
"paragraph": {
"rich_text": [
{
"text": {
"content": "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm."
}
}
]
}
}
]
}'
So, I felt confident and started building the Shortcut.
Using the “Get contents of URL” module I transposed the JSON data and I built this:
But differently of Postman I’m have issues.
But, when I run the shortcut I get this:
{
"status": 400,
"object": "error",
"code": "validation_error",
"message": "body failed validation. Fix one:nbody.properties.Title.title should be an array, instead was `{"content":""}`.nbody.properties.Title.rich_text should be defined, instead was `undefined`.nbody.properties.Title.number should be defined, instead was `undefined`.nbody.properties.Title.url should be defined, instead was `undefined`.nbody.properties.Title.select should be defined, instead was `undefined`.nbody.properties.Title.multi_select should be defined, instead was `undefined`.nbody.properties.Title.people should be defined, instead was `undefined`.nbody.properties.Title.email should be defined, instead was `undefined`.nbody.properties.Title.phone_number should be defined, instead was `undefined`.nbody.properties.Title.date should be defined, instead was `undefined`.nbody.properties.Title.checkbox should be defined, instead was `undefined`.nbody.properties.Title.relation should be defined, instead was `undefined`.nbody.properties.Title.files should be defined, instead was `undefined`.nbody.properties.Title.status should be defined, instead was `undefined`.nbody.properties.Title.id should be defined, instead was `undefined`.nbody.properties.Title.name should be defined, instead was `undefined`.nbody.properties.Title.start should be defined, instead was `undefined`."
}
That’s very strange to me considering the impossibility of Title having “checkbox” for instance.
I already lost the amount of attemps and modifications I did.
I can’t understand why using postman it works and using Shortcuts don’t.
Isaque Pereira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.