Created
May 20, 2021 03:38
-
-
Save dealingwith/d8e701f2e0e5e64cb820103af96a08d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let notionToken = await env('NOTION_USER_TOKEN') | |
let databaseID = "3859b567fda3464ea5a69d5ccb56274b" | |
let content = await arg('Enter Task') | |
let {data} = await post( | |
'https://api.notion.com/v1/pages', { | |
"parent": { "database_id": databaseID }, | |
"properties": { | |
"Name": { | |
"title": [ | |
{ | |
"text": { | |
"content": content | |
} | |
} | |
] | |
} | |
} | |
}, | |
{ | |
headers: { | |
Authorization: `Bearer ${notionToken}`, | |
} | |
}) | |
let pageID = data.id.replace(/-/g, ""); | |
let pageURL = `https://notion.so/${databaseID}?p=${pageID}` | |
copy(pageURL) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment