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

0 votes
Fabio Racobaldo _Herzum_
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 _Herzum_ 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
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!
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events