Skip to main content

Create page

POST 

/wiki/pages

History

VersionChanges
v6.12.0Added in: v6.12.0

Create page.

Page Type              content              cardsattachmentsresourcesattachmentOrResourceFileUUID
collaborationYes. The content is collaboration. json(Reference: Document Data Structure)YesYesYesYes

Sample curl request:

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

    The parent page ID

    title string

    The page title

    content string

    The content of page

    cards

    object[]

    The card list

  • Array [

  • id string

    The card ID

    type string

    Possible values: [attachments]

    The card type

    config

    object

    The card configuration

    oneOf

    attachments uuid[]

    The attachment ID list

  • ]

  • attachments uuid[]

    The attachment ID list

    resources uuid[]

    The resource ID list

    attachmentOrResourceFileUUID binary

    The key is not a fixed value. It is the ID of the resource or attachment, and the value is the file.

Responses

Request is successful.

Schema

    id string

    The page ID

    title string

    The page title

    spaceID string

    The space ID

    createdTime integer

    The createdTime of page

    updatedTime integer

    The updatedTime of page

    parentID string

    The parent page ID

    refType string

    The reference type

    refID string

    The reference ID

    subRefType string

    The sub reference type

    isArchived boolean

    Whether the page is archived

    encryptStatus string

    Encrypt status, none: not encrypted, encrypted: encrypted, readonly: readonly

    canEdit boolean

    Whether the page is editable

    locked boolean

    Whether the page is locked

Loading...