墨问 API
  1. 说明
墨问 API
  • 说明
    • 1. 概述
    • 2. NoteAtom 的结构说明
    • 3. 错误码
    • 4. ChangeLog
  • 关于MCP
    • MCP 使用指南
    • 常见问题
  • 授权
    • APIKey 重置
      POST
  • 笔记
    • 笔记创建
      POST
    • 笔记编辑
      POST
    • 笔记设置
      POST
  • 文件上传
    • 本地上传
      • 说明
      • 获取上传授权信息
      • 文件投递示例
    • 远程上传
      • 基于 URL 上传文件
  1. 说明

2. NoteAtom 的结构说明

NoteAtom 结构#

NoteAtom

说明#

NoteAtom 是笔记的原子结构。一个 NoteAtom 节点,可以包含其他的NoteAtom 节点,以一个树状的结构来描述一篇笔记。
NoteAtom 可以包含如下属性:
属性类型说明
typestring表示当前 atom 节点的类型,可能包含 doc(一篇笔记) paragraph(笔记中的段落) text(段落中的文本) 等类型。⚠️ 根节点的 type 必须是 doc
textstring节点的文本内容
marks[]NoteAtom由多个atom节点组成,通常用来修饰 text 文本的样式,如高亮 加粗 链接
attrsmap<string>string节点的属性
content[]NoteAtom当前节点的子节点,由多个atom节点组成。譬如一个doc 节点包含多个 paragraph 节点, paragraph 又可以包含多个 text 节点

举例#

{
   "type": "doc",
   "content": [
      {
         "content": [
            {
               "text": "这是一条 API 创建的笔记",
               "type": "text"
            }
         ],
         "type": "paragraph"
      },
      {
         "type": "paragraph"
      },
      {
         "content": [
            {
               "text": "第一段,普通文本段落",
               "type": "text"
            }
         ],
         "type": "paragraph"
      },
      {
         "type": "paragraph"
      },
      {
         "content": [
            {
               "text": "第二段,富文本段落 ",
               "type": "text"
            },
            {
               "marks": [
                  {
                     "type": "bold"
                  }
               ],
               "text": "加粗",
               "type": "text"
            },
            {
               "text": " ",
               "type": "text"
            },
            {
               "marks": [
                  {
                     "type": "highlight"
                  }
               ],
               "text": "高亮",
               "type": "text"
            },
            {
               "text": " ",
               "type": "text"
            },
            {
               "marks": [
                  {
                     "attrs": {
                        "href": "https://baidu.com"
                     },
                     "type": "link"
                  }
               ],
               "text": "链接",
               "type": "text"
            }
         ],
         "type": "paragraph"
      },
      {
         "type": "paragraph"
      },
      {
         "attrs": {
            "align": "center",
            "alt": "第二段与第三段之间插入一张图",
            "uuid": "iLg8nJvIhexM-VxBHjXYZ-TMP"
         },
         "type": "image"
      },
      {
         "type": "paragraph"
      },
      {
         "content": [
            {
               "text": "第三段,富文本段落 ",
               "type": "text"
            },
            {
               "marks": [
                  {
                     "attrs": {
                        "href": "https://bing.com"
                     },
                     "type": "link"
                  },
                  {
                     "type": "highlight"
                  },
                  {
                     "type": "bold"
                  }
               ],
               "text": "加粗并高亮的链接",
               "type": "text"
            }
         ],
         "type": "paragraph"
      },
      {
         "type": "paragraph"
      },
      {
         "attrs": {
            "audio-uuid": "iLg8nJvIhexM-VxBHjXYZ-TMP",
            "show-note": "00:00 这里是音频 ShowNote\n02:00 开头\n04:00 结尾"
         },
         "type": "audio"
      },
      {
         "type": "paragraph"
      },
      {
         "content": [
            {
               "text": "第四段,引用文本段落",
               "type": "text"
            }
         ],
         "type": "quote"
      },
      {
         "type": "paragraph"
      },
      {
         "content": [
            {
               "text": "第五段,引用文本段落也可以有富文本 ",
               "type": "text"
            },
            {
               "marks": [
                  {
                     "attrs": {
                        "href": "https://bing.com"
                     },
                     "type": "link"
                  },
                  {
                     "type": "highlight"
                  },
                  {
                     "type": "bold"
                  }
               ],
               "text": "加粗并高亮的链接",
               "type": "text"
            }
         ],
         "type": "quote"
      },
      {
         "type": "paragraph"
      },
      {
         "attrs": {
            "uuid": "pnYaQHZpippbfleHTrVa-"
         },
         "type": "note"
      },
      {
         "attrs": {
            "uuid": "ew6POhwnucrXmWNRTuXYZ-TMP"
         },
         "type": "pdf"
      }
   ]
}
image.png
修改于 2025-06-10 11:38:55
上一页
1. 概述
下一页
3. 错误码
Built with