跳到主要内容

创建页面

POST 

/wiki/pages

创建页面。不同页面类型的支持情况:

页面类型contentcardsattachmentsresourcesattachmentOrResourceFileUUID
collaboration支持。内容为协同页面 json支持支持支持支持

History

VersionChanges
v6.12.0Added in: v6.12.0

创建页面。不同页面类型的支持情况:

页面类型              content              cardsattachmentsresourcesattachmentOrResourceFileUUID
collaboration支持。内容为协同页面 json(参考:文档数据结构支持支持支持支持

curl 示例:

curl --location --request POST 'https://your-domain/openapi/v2/wiki/pages?teamID=<teamID>' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'parentPageID="<ParentPageID>"' \
--form 'title="open api from form-data"' \
--form 'attachments="[\"attachmentRandomId\"]"' \
--form 'attachmentRandomId=@"your-attachment-file"' \
--form 'resources="[\"resourceRandomId\"]"' \
--form 'resourceRandomId=@"your-resource-file"' \
--form 'cards="[{\"type\": \"attachment\", \"config\": [\"attachmentRandomId\"], \"id\": \"cardRandomId\"}]"' \
--form 'content="{
\"blocks\": [
{
\"id\": \"fkpFQHTFP\",
\"type\": \"text\",
\"text\": [
{
\"insert\": \"open api from form-data\"
}
],
\"heading\": 1,
\"quoted\": false
},
{
\"id\": \"zrzebX_5P\",
\"type\": \"text\",
\"text\": [
{
\"insert\": \"资源\"
}
],
\"heading\": 2
},
{
\"id\": \"bBb4SGK_9\",
\"type\": \"text\",
\"text\": [
{
\"insert\": \"embedData 里面的 src 是资源随机 ID。上传文件的 key 和此 ID 相同,value 是具体的资源文件。\"
}
]
},
{
\"id\": \"Nckftr1QB\",
\"type\": \"embed\",
\"embedType\": \"image\",
\"align\": \"left\",
\"embedData\": {
\"src\": \"resourceRandomId\",
\"widthPercent\": 41.83070866141732,
\"8c8d4fa06483a35dffa314ec88fad792_width\": 425,
\"8c8d4fa06483a35dffa314ec88fad792_height\": 307,
\"0_flex\": 1
}
},
{
\"id\": \"hYtCamqSj\",
\"type\": \"text\",
\"text\": [
{
\"insert\": \"附件卡片\"
}
],
\"heading\": 2
},
{
\"id\": \"DWkP4GVAF\",
\"type\": \"text\",
\"text\": [
{
\"insert\": \"embedData 里面的 cardUuid 是卡片随机 ID。cards 列表中的 ID 和此 ID 相同。卡片包含哪些卡片,也是由 cards 列表中的 attachments 决定。attachments 列表中的 ID 是附件随机 ID。上传文件中的 key 和此 ID 相同,value 是具体的附件文件。\"
}
]
},
{
\"id\": \"fadFDWnZY\",
\"type\": \"embed\",
\"embedType\": \"file-list\",
\"embedData\": {
\"cardUuid\": \"cardRandomId\"
}
},
{
\"id\": \"PNWe0PcC7\",
\"type\": \"text\",
\"text\": []
}
]
}"'

Request

Body

required

    parentPageID string

    父页面 ID

    title string

    页面名称

    content string

    页面内容

    cards

    object[]

    卡片列表

  • Array [

  • type string

    Possible values: [attachments]

    卡片类型

    id uuid

    卡片 ID

    config

    object

    卡片配置

    oneOf

    attachments uuid[]

    附件卡片配置,是附件 ID 数组

  • ]

  • attachments uuid[]

    附件 ID 列表

    resources uuid[]

    资源 ID 列表,资源是页面中的图片、视频、音频等多媒体资源

    attachmentOrResourceFileUUID binary

    key 不是固定值。是资源或者附件的 ID,value 是文件。

Responses

成功

Schema

    id string

    页面 ID

    title string

    页面名称

    spaceID string

    页面组 ID

    createdTime integer

    创建时间

    updatedTime integer

    更新时间

    parentID string

    父页面 ID

    refType string

    引用类型

    refID string

    引用 ID

    subRefType string

    子引用类型

    isArchived boolean

    是否归档

    encryptStatus string

    加密状态,none: 未加密,encrypted: 已加密,readonly: 只读

    canEdit boolean

    是否可编辑

    locked boolean

    是否锁定

Loading...