【发布时间】:2014-05-07 16:49:57
【问题描述】:
我需要使用 rest api 在 confluence 中创建新 wiki 页面的工作示例。我更喜欢在特定空间和特定页面下创建新页面。我阅读了他们的 api 文档并查看了他们拥有的一些示例,但仍然不足。
这是他们网站上的一个例子
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool
我在上面尝试了我的空间名称、新标题并将 url 更改为 mysite/rest/api/content 并且返回的内容基本上是html页面,说页面不存在或页面存在但您没有权限。我已经确认我可以访问 confluence wiki 并且可以使用我的凭据创建新的 wiki。
在上面的示例中,还不清楚的是它是如何调用创建页面的特定 api 的?这没有意义。
在他们的论坛上提出了类似的问题,但没有合理的答案 https://answers.atlassian.com/questions/149561/simple-confluence-rest-api-usage-what-am-i-missing
(我想我的最终目标是能够在 confluence 上自动创建新的 wiki 页面)如果需要,我可以放弃 confluence REST API 到其他解决方案。
【问题讨论】:
-
老但有效的问题,这里是他们的规范:developer.atlassian.com/cloud/confluence/rest/… 还有几种语言的例子,来自 curl、nodejs 等。
标签: confluence confluence-rest-api