简体   繁体   English

您如何使用他们的 REST api 向 Atlassian confluence 发表评论?

[英]How do you post a comment to Atlassian confluence using their REST api?

I'm trying to automatically add a comment to a page in confluence using the REST API.我正在尝试使用 REST API 在 confluence 中自动向页面添加评论。

I am testing using Postman, im pointing at this url: https://###########.atlassian.net/wiki/rest/api/content/我正在使用邮递员进行测试,我指向这个网址: https://###########.atlassian.net/wiki/rest/api/content/

using valid headers, and posting this json:使用有效的标头,并发布此 json:

{  
    "type":"comment",
    "container":"72025106",
    "body":{  
        "storage":{  
            "value":"auto comment 1",
            "representation":"storage"
        }
    }
}

When I do i get this error back:当我这样做时,我又得到了这个错误:

{
    "statusCode": 500,
    "message": "java.lang.IllegalStateException: Must provide id and type for Content"
}

this should work:这应该有效:

{"type":"comment",
   "container":{
       "id":"[PARENT_ID]",
       "type":"page",
       "status":"current"
   },
   "body":{
      "storage":{
         "value":"[COMMENT_BODY]",
         "representation":"storage"
      }
   }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得 POST 请求以在 Confluence REST API 中工作? - How do I get a POST request to work in Confluence REST API? 如何将Confluence宏插入Confluence Rest Api创建的页面? - How do you insert a confluence macro into a page created by the Confluence Rest Api? 使用 Java 通过 Rest API 在 Confluence 页面上发布 html 文件 - Post html files on Page In Confluence Via Rest API using Java 如何使用jQuery及其REST API在Confluence中创建新页面? - How to create a new page in Confluence using jQuery and their REST API? 如何使用Rest API使用JiraChart创建融合页面 - How to create confluence page with JiraChart using Rest API 您如何使用 jersey REST Webtarget API 发布对象的 json 列表? - 未找到错误 MessageBodyWriter - How do you POST a json list of objects using the jersey REST Webtarget API? - getting error MessageBodyWriter not found 您如何使用REST API发布到parse.com? - How can you POST to parse.com using REST API? 使用Confluence REST API发布生成的html表(PHP)而不获取http 400状态代码? - Using Confluence REST API to post generated html table (PHP) without getting http 400 status code? 如何:[REST] 使用 REST API 以编程方式获取和设置 Atlassian Stash (Bitbucket Server) 中存储库的默认审阅者 - How to: [REST] Get and Set Default Reviewers for a repository in Atlassian Stash (Bitbucket Server) programmatically using REST API 如何使用WizTools Rest Client发送POST? - How do you send a POST using WizTools Rest Client?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM