How to read a table from Confluence page via API?

Ginna Khang
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!
September 20, 2023

I'm trying to create an app that would read from a table that has multiple columns and rows.

 

Using the REST API I am able to retrieve the page and expand the table information using the following route:

 

const fetchConfluenceBody = await api.asApp().requestConfluence(route`/wiki/api/v2/pages/7634945?body-format=atlas_doc_format`, {
        headers: {
          'Accept': 'application/json'
        }
    });
How will I be able to parse through the table in an organized manner to search for the information I need? With the current format I have (atlas_doc_format), I see a lot of "type" and "content" but am unable to access the information values.
Thanks
  
image.png

1 answer

0 votes
GMK
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2023

Hello @Ginna Khang

Check https://github.com/atlassian-api/atlassian-python-api  library (note: it is a community project, it is not owned/maintained by Atlassian). 

Specifically look for Confluence method:  get_tables_from_page

Aleksandar Loncar
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!
February 5, 2024

hi, i have the same problem

im trying to create new page using v2 API from existing content but confluence wont accept .html format no matter which representation i use, im getting raw html code instead of html tables in the page with 200 ok status

also im using nodejs, anybody got the solution for this maybe?



 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events