I am following confluence rest api and trying to get confluence page content which contains Jira issue macro. The problem lies that the other content is normally loaded while the Jira issue macro are not being loaded?? Is there any another API I need to use to get the confluence page along with it's Jira Issue macro??? Can anyone suggest some solution related to current situation. The below image represents the response I get while calling the confluence page.
I am using this confluence rest api as reference:-
http://localhost:8080/confluence/rest/api/content/search?cql=space=DEV%20AND%20label=docs&expand=body.view.value
Hello @Rashida Bharmal ,
Welcome to the Atlassian Community!
If you want to see the page content then, instead of sending a request to the search (GET /rest/api/content/search) endpoint, you should use one of the below adding the expand=body.storage property:
GET/rest/api/content)
(GET/rest/api/content/{id})
An example is available in the Confluence REST API examples page:
Read content, and expand the body
This example shows how you can read content of a page with the body expanded.
curl -u admin:admin http://localhost:8080/confluence/rest/api/content/3965072?expand=body.storage |python -mjson.tool
Example result:
{ "_expandable": { "ancestors": "", "children": "", "container": "", "history": "/rest/api/content/3965072/history", "metadata": "", "space": "/rest/api/space/TST", "version": "" }, "_links": { "base": "http://localhost:8080/confluence", "collection": "/rest/api/contents", "self": "http://localhost:8080/confluence/rest/api/content/3965072", "tinyui": "/x/kIA8", "webui": "/display/TST/Test+Page" }, "body": {_ "editor": { "_expandable": { "content": "/rest/api/content/3965072" }, "representation": "editor" }, "export_view": { "_expandable": { "content": "/rest/api/content/3965072" }, "representation": "export_view" }, "storage": { "_expandable": { "content": "/rest/api/content/3965072" }, "representation": "storage", "value": "<p>blah blah</p>" }, "view": { "_expandable": { "content": "/rest/api/content/3965072" }, "representation": "view" } }, "id": "3965072", "title": "Test Page", "type": "page" }
I hope this helps.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.