The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to access a table on a page via the Confluence Rest API

StuartJames.McIntosh
October 10, 2022

Using Python and the Confluence Rest API I can return the JSON for a page, given its page id, e.g. https://confluence.xxx.com/rest/api/content/1234567890

within that page I created a small table. I want to 1. find the table and 2. return the contents of the table.

From reading the documentation I think I need to expand the body of the page, but I'm having trouble determining the correct syntax for the URL.

Could someone please help???

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Fabio Racobaldo _Catworkx_
Community Champion
October 10, 2022

Hi @StuartJames.McIntosh ,

welcome to the Atlassian community!

You need the following rest API https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-wiki-rest-api-content-get to get content and then find your portion of page.

Hope this helps,

Fabio

StuartJames.McIntosh
October 10, 2022

@Fabio Racobaldo _Catworkx_ thanks for your help. I'm now able to see the table information using the following url, but it's all in html, which I guess I'd have to parse to extract the data. 

https://confluence.xxx.com/rest/api/content/123456789?expand=body.view

Is there a better way to get at the table, e.g. by somehow treating it as a Confluence object within that page? Or will I have to parse the html to get at the data within the table?

-Stuart.

Joe Chalhoub
December 13, 2023

any news about this issue? I am facing the exact issue.

Like Merchant, Craig likes this
Merchant, Craig
January 11, 2024

Agreed.  Also trying to download a table from the Confluence API and it's downloading the entire HTML of the page and not the table object specifically...

Like Ian Beyer likes this
TAGS
AUG Leaders

Atlassian Community Events