我想在Confluence中检索页面的所有版本.REST API中有一个声称要返回历史记录的调用,但我没有运气.
/rest/api/content/{id}/history
Run Code Online (Sandbox Code Playgroud)
当我打电话给我时,我会得到以下这样的答复:
{"latest": true,
"createdBy": {
"type": "known",
"profilePicture": {
"path": "/confluence/s/en_GB/.../profilepics/Avatar-14.png",
"width": 48,
"height": 48,
"isDefault": false
},
"username": "first.last@abc123.com",
"displayName": "First Last",
"userKey": "userKey"
}, "createdDate": "2014-12-29T13:56:16.000+0100", "_links": {
"base": "https://host.abc123.net/confluence",
"context": "/confluence",
"self": "host.abc123.net/confluence/rest/api/content/12345678/history"
}, "_expandable": {
"lastUpdated": ""
}}
Run Code Online (Sandbox Code Playgroud)
我知道这个页面通过浏览器界面在历史上有17个版本.我似乎无法通过向查询添加任何类型的expand =来获取任何内容.
Confluence REST API的文档告诉我这个调用应该:
返回内容历史记录的完整JSON表示形式
如果我转向"正常"REST API调用来检索内容,我可以获得一些关于版本结构中的历史记录的提示:
{"version": {
"by": {
"type": "known",
"profilePicture": {
"path": "/confluence/s/en_GB/5639/.../profilepics/default.png",
"width": 48,
"height": 48,
"isDefault": true
},
"username": "some.other@abc123",
"displayName": "Some Other",
"userKey": "userKeyGuidThingy"
},
"when": "2015-01-30T16:00:09.000+0100", …Run Code Online (Sandbox Code Playgroud)