
Found it, here the solution for documentation :
function tryout_notion () {
const url = "https://api.notion.com/v1/pages";
var payload = {
"parent": {
"type": "database_id",
"database_id": "*****"
},
"properties": {
"Name": {
"title": [
{
"text": {
"content": "CREATE NEW LINE IN NOTION"
}
}
]
}
}
}
var options = {
'muteHttpExceptions': true,
"method" : "post",
"headers": {
Authorization: `Bearer secret_*****`,
"Content-Type": "application/json",
"Notion-Version": "2021-05-13",
},
"payload": JSON.stringify(payload)
};
const response = UrlFetchApp.fetch(url, options);
Logger.log(response);
}