How can we see jira issue macro in API called confluence page
Asked by Rashida Bharmal:

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`

![Screenshot from 2020-03-12 09-55-24.png](https://community.atlassian.com/t5/image/serverpage/image-id/86302iE9A6488771913A1A/image-size/large?v=v2&px=999 "Screenshot from 2020-03-12 09-55-24.png")


Answers:
author: Dario B
body: Hello [@Rashida Bharmal](/t5/user/viewprofilepage/user-id/3696901) ,

Welcome to the Atlassian Community!

If you want to see the page content then, instead of sending a request to the [search](https://docs.atlassian.com/ConfluenceServer/rest/7.3.3/#api/content-search) (GET /rest/api/content/search) endpoint, you should use one of the below adding the expand=body.storage property:

* [Get content](https://docs.atlassian.com/ConfluenceServer/rest/7.3.3/#api/content-getContent) (`GET/rest/api/content)`
* [Get content by id](https://docs.atlassian.com/ConfluenceServer/rest/7.3.3/#api/content-getContentById) `(GET/rest/api/content/{id}) `

An example is available in the [Confluence REST API examples](https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/) page:
>
> ### Read content, and expand the body {#toc-hId-1140865609}
>
> This example shows how you can read content of a page with the body [expanded](https://developer.atlassian.com/server/confluence/expansions-in-the-rest-api).  
>
> ```
> `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


Tags: atl-adm

confluence-server

jira

server