You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I am a community developer trying to build a Confluence app that must scrape textual page content. I am having trouble getting the actual page content.
I am able to successfully query pages using the pages endpoint (GET /wiki/api/v2/pages)
Here is the output
results: [
{
id: 98383,
version: [Object],
authorId: '6237c985ee1b5a0070273f6b',
title: 'Overview',
status: 'CURRENT',
body: {},
parentId: null,
spaceId: 98306,
createdAt: '2023-01-25T09:40:17.506Z'
}
...]
Notice here that body is empty! I have also tried using the solution here by trying to use the deprecated content endpoint, along with optional parameter `?expand=body.storage`
/wiki/api/v2/content/98533?expand=body.storage
This leads to a scope error:
{ code: 401, message: 'Unauthorized; scope does not match' }
I feel I have the right scopes, as I have reviewed the documentation extensively:
scopes:
- read:page:confluence
- read:content:confluence
- read:custom-content:confluence
- read:confluence-props
- read:confluence-content.all
- read:content-details:confluence
Can someone guide me here? I would really appreciate guidance on retrieving post content.
Hi @ruchirbaronia_gmail_com , welcome to the Community!
You're on the right track - the API endpoint you have will return the content if you specify the format you want the body in (either storage or atlas_doc_format) as the body-format query parameter. You can do this with either the /pages endpoint itself to get this for multiple pages at once, or by ID as you had in your example:
/wiki/api/v2/pages/98533?body-format=storage
If you pull the atlas_doc_format type, you can use this documentation and example libraries to parse the format as you need.
Cheers,
Daniel | Atlassian Staff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.