page by id excerpt different from pages in space excerpt

Mark Small
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2024

I am using theV2 of the Cloud API and am seeing different results when querying for a page by id and pages in space. I am using the Postman Collection from https://developer.atlassian.com/cloud/confluence/rest/v2/intro.

 

I have a page hierarchy of:

Legal

    Legal Page 1

    Legal Page 2

 

I use 2 different API endpoints:

 

* /wiki/api/v2/pages/:id?body-format=atlas_doc_format

* /wiki/api/v2/spaces/:id/pages?sort=title&body-format=atlas_doc_format

 

Each page uses the excerpt extension to represent a synopsis of the page, to be displayed in my app. The excerpt has been changed numerous times now, but when I use the Pages in Space, I always get an old version of the text in the response, yet when I use the Page by Id endpoint, I get the right value.

I have check that the page status is current and that the page id's match and they do, so it can't be that. I have checked any trashed pages and purged them, so it cannot be that either.

This is what I should get and do by getting the page by ID:

 

{
"type": "doc",
"content": [
{
"type": "bodiedExtension",
"attrs": {
"layout": "default",
"extensionType": "com.atlassian.confluence.macro.core",
"extensionKey": "excerpt",
"parameters": {
"macroParams": {},
"macroMetadata": {
"macroId": {
"value": "00054190-c178-45cf-bb67-46e0198ddda0"
},
"schemaVersion": {
"value": "1"
},
"title": "Excerpt"
}
},
"localId": "e526e023-d3b7-4177-91e3-3467ad360faa"
},
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Legal guidance for use of our data and services",
"type": "text"
}
]
}
]
},
{
"type": "paragraph"
}
],
"version": 1
}
this is what I get from the pages in space (edited down of course:
{
"type": "doc",
"content": [
{
"type": "bodiedExtension",
"attrs": {
"layout": "default",
"extensionType": "com.atlassian.confluence.macro.core",
"extensionKey": "excerpt",
"parameters": {
"macroParams": {},
"macroMetadata": {
"macroId": {
"value": "774b2493-62ad-4411-9a07-1c94f1a950da"
},
"schemaVersion": {
"value": "1"
},
"title": "Excerpt"
}
},
"localId": "3e0f1cc8-5285-4a3f-94da-7570ea195a8b"
},
"content": [
{
"type": "paragraph",
"content": [
{
"text": "This is the Legal Excerpt",
"type": "text"
}
]
}
]
},
{
"type": "paragraph"
}
],
"version": 1
}
I do notice that the macroId and localId are different and must be pointing to different objects, resulting in this issue.
Does anyone have any ideas on how to resolve this inconsistency. I would like to avoid having to make a separate call for each page as there are hundreds and potentially thousands of pages to come along and will be very slow.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events