这里写自定义目录标题
Conflunce API 创建更新页面
官方api文档地址:https://docs.atlassian.com/ConfluenceServer/rest/7.11.6/#api/content
**conflunce_host Conflunce服务host
port Conflunce服务port
space_key 空间的key
page_id 页面ID
**
获取页面信息 :
接口参数:
属性 | 类型 | 是否必须 | 默认值 | 示例 | 说明 |
---|---|---|---|---|---|
spaceKey | String | Y | space_key | space_key | 空间key |
title String | Y | title_name | 页面page名 | ||
expand | String | N | space,body.view,version,container | 页面属性信息 |
Example:
GET http://conflunce_host:port/rest/api/content?spaceKey=space_key&title=test_page&expand=space,body.view,version,container
使用此接口获取 space_key、page_id
创建页面:
接口参数:
属性 | 类型 | 是否必须 | 默认值 | 示例 | 说明 |
---|---|---|---|---|---|
type | String | Y | page | page | the content type to return. Default value: page. |
status | String | Y | current | current | list of statuses the content to be found is in. Defaults to current is not specified. If set to ‘any’, content in ‘current’ and ‘trashed’ status will be fetched. Does not support ‘historical’ status for now. |
title | String | Y | 页面page名 | ||
space | String | Y | {“key”: “space_key”} | 空间key信息 | |
ancestors | String | Y | [{“id”: page_id}] | 父页面ID | |
body | String | Y | 页面body内容 |
Example:
POST http://conflunce_host:port/rest/api/content
{
"type": "page",
"status": "current",
"title": "just test confluence api create page",
"space": {"key": "space_key"},
"ancestors": [{"id": 11111111}],
"body": {"storage": {"value": "<p>New page data for confluence api create page.</p>","representation": "storage"}}
}
更新conflunce页面:
接口参数:
属性 | 类型 | 是否必须 | 默认值 | 示例 | 说明 |
---|---|---|---|---|---|
type | String | Y | page | page | the content type to return. Default value: page. |
status | String | Y | current | current | list of statuses the content to be found is in. Defaults to current is not specified. If set to ‘any’, content in ‘current’ and ‘trashed’ status will be fetched. Does not support ‘historical’ status for now. |
version | String | Y | { “number”: 2 } | 最新的版本号+1 | |
title | String | Y | 页面page名 | ||
space | String | Y | {“key”: “space_key”} 空间key信息 | ||
ancestors | String | Y | [{“id”: page_id}] | 父页面ID | |
body | String | Y | 页面body内容 |
Example:
PUT http://conflunce_host:port/rest/api/content/update_page_id
{
"type": "page",
"status": "current",
"version": { "number": 2 },
"title": "just test confluence api create page",
"space": { "key": "space_key" },
"ancestors": [ { "id": 111111111 } ],
"body": { "storage": { "value": "<p>New page data for confluence api update page.</p>", "representation": "storage" }
}
}