Going Stellar

Home/Atlassian REST API reference

Jira and Confluence Cloud REST API

Footer comments on Confluence pages by REST API

POST /wiki/api/v2/footer-comments creates a top-level comment from a pageId and a body in storage format. Replies take parentCommentId instead. GET /wiki/api/v2/pages/{id}/footer-comments lists them, with body-format asking for the text.

Endpoints

MethodPathWhat it does
POST/wiki/api/v2/footer-commentsCreates a footer comment on a page, as a reply, or on an attachment.
GET/wiki/api/v2/pages/{id}/footer-commentsLists the footer comments of a page.
DELETE/wiki/api/v2/footer-comments/{comment-id}Deletes a footer comment.

Examples

Adds a top-level comment to a page.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "pageId": "{pageId}",
  "body": {
    "representation": "storage",
    "value": "<p>A footer comment.</p>"
  }
}' \
  'https://your-domain.atlassian.net/wiki/api/v2/footer-comments'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/wiki/api/v2/footer-comments',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'pageId': '{pageId}',
          'body': {'representation': 'storage', 'value': '<p>A footer comment.</p>'}},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "33915129",
 "title": "Re: Example page",
 "pageId": "33653083",
 "version": {
  "number": 1
 },
 "body": {
  "storage": {
   "representation": "storage",
   "value": "<p>A footer comment.</p>"
  }
 }
}

Response headers

Location: /wiki/api/v2/footer-comments/33915129

Sent to Atlassian Cloud on .

Lists the comments and asks for the body in storage format.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'body-format=storage' \
  'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}/footer-comments'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}/footer-comments',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'body-format': 'storage'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "results": [
  {
   "id": "33915129",
   "title": "Re: Example page",
   "pageId": "33653083",
   "resolutionStatus": "open",
   "body": {
    "storage": {
     "representation": "storage",
     "value": "<p>A footer comment.</p>"
    }
   }
  }
 ]
}

Sent to Atlassian Cloud on .

Deletes the comment by id.

curl

curl -X DELETE \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/wiki/api/v2/footer-comments/{commentId}'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.delete(
    'https://your-domain.atlassian.net/wiki/api/v2/footer-comments/{commentId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)

Response: HTTP 204

No response body.

Sent to Atlassian Cloud on .

How it behaves

  • The create call answers 201 and a Location header with the path of the new comment (conf-footer-comment-add).
  • The title of the comment is generated: "Re: Example page" (conf-footer-comment-add).
  • The list returns resolutionStatus "open" for the comment and the body in the requested format (conf-footer-comments).
  • Delete answers 204 (conf-footer-comment-delete).

Pitfalls

  • Give pageId for a top-level comment and parentCommentId for a reply, never both. The spec says so for each field.
  • The body object uses representation and value, the same shape as the page body.
  • Comments created by a script show the account of the token, so use a dedicated account when comments must be told apart.

Questions and answers

Does create return 201 for pages too?

No. The page create call returned 200.

Sources

  1. Create footer comment (Confluence REST API v2)
  2. The Confluence Cloud REST API v2 (Atlassian Developer)

Markdown version · All REST API pages