Skip to content

Instantly share code, notes, and snippets.

@kkemple
Created April 12, 2022 21:24
Show Gist options
  • Save kkemple/3f54e1d0af6d82a9e5eb8222b928783e to your computer and use it in GitHub Desktop.
Save kkemple/3f54e1d0af6d82a9e5eb8222b928783e to your computer and use it in GitHub Desktop.
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