Conflunce API 创建更新页面

这里写自定义目录标题

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
**

获取页面信息 :
接口参数:

属性类型是否必须默认值示例说明
spaceKeyStringYspace_keyspace_key空间key
title StringYtitle_name页面page名
expandStringNspace,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

创建页面:
接口参数:

属性类型是否必须默认值示例说明
typeStringYpagepagethe content type to return. Default value: page.
statusStringYcurrentcurrentlist 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.
titleStringY页面page名
spaceStringY{“key”: “space_key”}空间key信息
ancestorsStringY[{“id”: page_id}]父页面ID
bodyStringY页面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页面:
接口参数:

属性类型是否必须默认值示例说明
typeStringYpagepagethe content type to return. Default value: page.
statusStringYcurrentcurrentlist 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.
versionStringY{ “number”: 2 }最新的版本号+1
titleStringY页面page名
spaceStringY{“key”: “space_key”} 空间key信息
ancestorsStringY[{“id”: page_id}]父页面ID
bodyStringY页面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"        }
    }
}
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值