Created
April 12, 2022 21:24
-
-
Save kkemple/3f54e1d0af6d82a9e5eb8222b928783e to your computer and use it in GitHub Desktop.
This file contains 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
import { axios } from "@pipedream/platform" | |
import { format } from "date-fns" | |
export default defineComponent({ | |
props: { | |
notion: { | |
type: "app", | |
app: "notion", | |
} | |
}, | |
async run({steps, $}) { | |
const data = { | |
parent: { | |
database_id: "84bfb4cc5108431199ebac8681f35d47", | |
}, | |
icon: { | |
type: "emoji", | |
emoji: "📝" | |
}, | |
properties: { | |
Entry: { | |
title: [ | |
{ | |
text: { | |
content: format(Date.now(), "LLLL do, yyyy"), | |
}, | |
}, | |
], | |
}, | |
}, | |
}; | |
return await axios($, { | |
url: `https://api.notion.com/v1/pages`, | |
headers: { | |
Authorization: `Bearer ${this.notion.$auth.oauth_access_token}`, | |
"Notion-Version": `2021-08-16`, | |
}, | |
method: "POST", | |
data, | |
}); | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment