Confluence Cloud Rest API: Fetch page comments

WidWid September 28, 2020

I need to fetch all page comments include child comments.

I can only see this rest api to fetch page first level comments:

/wiki/rest/api/content/{id}/child/comment

I am using java with confluence cloud rest api

 

any idea is greatly appreciated. 

 

2 answers

3 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 29, 2020

Hello @WidWid ,

Welcome to the Atlassian Community!

The endpoint your have found is the correct one. However, in order to get all the comments you should use:

  • wiki/rest/api/content/{ID}/child/comment?expand=body.view&depth=all

Another option could be:

  • wiki/rest/api/content/{ID}/child/comment?expand=children.comment

 

For further details please see:

 

I hope this helps.

 

Cheers,
Dario

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2020

Hi @WidWid 

I had a look in the REST API from confluence cloud and found the API, which you found: 

https://developer.atlassian.com/cloud/confluence/rest/api-group-content-comments/#api-api-content-id-child-comment-get 

But here it is described:

depth

string

Currently, this parameter is not used. Comments are returned at the root level only.

What I found is a way to get 2 level with this:

/wiki/rest/api/content/{id}/child/comment?expand=children.comment

I'm not very familiar with comments, but comments are "content" as well. So you can get all first level comments and make a for each and set another REST call with the ContentID's you found. This you can do within Java. Do you know what I mean?

Regards, Dominic

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events