0

trying confluence rest api to read comments for given page - from below rest calls but its giving different result when add expand (_expandable) body.view

Total : comment for given ID (some page id) is 28

Request 1) able to get 25 in first and rest 3 with next link Request 2) not able to get 25 in first call


Request 1:

/rest/api/content/ID/child/comment

Results:

{
  results : [ from 1 to 25 ],
"start": 0,
    "limit": 25,
    "size": 25,
    "_links": {
        "self": "/rest/api/content/ID/child/comment?limit=25",
        "next": "/rest/api/content/ID/child/comment?limit=25&start=25",
        "base": "baseurl",
        "context": ""
    }

Request 2: only changed to add expand

/rest/api/content/ID/child/comment?expand=body.view

Results:

{
  results : [ from 1 to 0],
"start": 0,
    "limit": 25,
    "size": 20,
    "_links": {
        "self": "/rest/api/content/ID/child/comment?limit=25",
        "next": "***0/***rest/api/content/ID/child/comment?limit=25&start=25",
        "base": "baseurl",
        "context": ""
    }

Any suggestion why ?

skaffman
  • 398,947
  • 96
  • 818
  • 769
nik
  • 1
  • 2
  • also i do get additional "0" in front of next url in response for example - not sure what that mean -- "next": "0/rest/api/content/ID/child/comment?limit=25&start=25" – nik Mar 27 '15 at 18:36
  • not sure its api bug or thats how "expand=body.view" behave - version am using is confluence-5.6.1 – nik Mar 27 '15 at 19:04
  • Looks like a bug to me. It's still a work in progress, but may have been fixed in 5.7. I suggest filing an issue at https://jira.atlassian.com/projects/CRA – skaffman Mar 31 '15 at 08:53
  • Thanks skaffman - its looks other work around i found it to use – nik Mar 31 '15 at 15:08
  • Thanks skaffman - it looks like bug ---- other work around i found it to use expand in second call first call without expand and when it say or return next link use expand - /rest/api/content/ID/child/comment?expand=body.view -- only disadvantage is that i have to make additional call to pull body for those there is no body - – nik Mar 31 '15 at 15:32
  • another bug i found with api is that - Size its say 8 - how ever in those 8 one record came twice (technically its only 7) - not sure how many more am going to find. – nik Mar 31 '15 at 15:33

0 Answers0