Create page
POST/wiki/pages
History
Version | Changes |
---|---|
v6.12.0 | Added in: v6.12.0 |
Create page.
Page Type | content | cards | attachments | resources | attachmentOrResourceFileUUID |
---|---|---|---|---|---|
collaboration | Yes. The content is collaboration. json(Reference: Document Data Structure) | Yes | Yes | Yes | Yes |
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
- multipart/form-data
Body
required
Array [
- MOD1
]
The parent page ID
The page title
The content of page
cards
object[]
The card list
The card ID
Possible values: [attachments
]
The card type
config
object
The card configuration
oneOf
The attachment ID list
The attachment ID list
The resource ID list
The key is not a fixed value. It is the ID of the resource or attachment, and the value is the file.
Responses
- 200
- 401
- 403
- 404
- 500
Request is successful.
- application/json
- Schema
- Example (from schema)
Schema
The page ID
The page title
The space ID
The createdTime of page
The updatedTime of page
The parent page ID
The reference type
The reference ID
The sub reference type
Whether the page is archived
Encrypt status, none: not encrypted, encrypted: encrypted, readonly: readonly
Whether the page is editable
Whether the page is locked
{
"id": "string",
"title": "string",
"spaceID": "string",
"createdTime": 0,
"updatedTime": 0,
"parentID": "string",
"refType": "string",
"refID": "string",
"subRefType": "string",
"isArchived": true,
"encryptStatus": "string",
"canEdit": true,
"locked": true
}
Returned if the authentication credentials are incorrect or missing.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Unauthorized",
"errorMsg": "Access token is invalid"
}
Returns if the scope check fails.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Forbidden",
"errorMsg": "Scope is invalid"
}
Returned if the resource object was not found.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "NotFound",
"errorMsg": "Not Found"
}
Internal Server Error.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Internal Server Error",
"errorMsg": "Internal Server Error"
}