即使在提供标题后,概念 js SDK 也会询问标题

Notion js SDK asks for title even after title is provided

我正在尝试使用 notion sdk 创建一个数据库,这就是我的有效载荷的样子:

  parent: {
    type: "page_id",
    page_id: process.env.PAGE_ID,
  },
  icon: {
    type: "emoji",
    emoji: "",
  },
  title: [
    {
      type: "text",
      text: {
        content: "DB Title",
      },
    },
  ],
  properties: {
    "Prop-1": {
      date: {},
    },
    "Prop-2": {
      multi_select: {
        options: [
          {
            name: "option-1",
            color: "green",
          },
          {
            name: "option-2",
            color: "gray",
          },
          {
            name: "option-3",
            color: "pink",
          },
        ],
      },
    },
    "prop-3": {
      multi_select: {
        options: [],
      },
    },
  },

我已经添加了上面可以看到的标题,但是响应给出了 400 状态代码。

@notionhq/client warn: request fail { code: 'validation_error', message: 'Title is not provided' }

不知道我哪里出错了。

您还需要在属性中添加标题列。查看文档中的示例负载,您将看到一个“名称”标题列。 https://developers.notion.com/reference/create-a-database