API call to update expand section stopped working on 4/23/24

Duane Kuroda April 25, 2024

I have been using the API to update a confluence page with 3 expand sections. It was working perfectly for weeks, then on 4/23/24 it stopped working, throwing the error:

{'statusCode': 400, 'data': {'authorized': True, 'valid': True, 'errors': [], 'successful': True}, 'message': 'com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format'}

Through various testing, the error has been localized to using a table in my expand section. This was working until 4/23. The table is a dataframe converted to html. I've tried to convert the dataframe to html in two ways. Example code below:

df3 = pd.read_csv('<filename and path>')
table3 = df3.to_html(index=False, escape=False)

also did the following:

def dataframe_to_confluence_table(df):
     html = ['<table>']
     for i, row in df.iterrows():
          html.append('<tr>')
          for val in row:
                html.append(f'<td>{val}</td>')
          html.append('</tr>')
     html.append('</table>')
     return ''.join(html)
# Convert DataFrame to Confluence-compatible HTML table
table3 = dataframe_to_confluence_table(df3)
And the expand section definition (that used to work, but now fails):
expand_section3 = create_expand_section('Expand to view Data in the last 3d', table3)
I'm frustrated since my code was working fine for weeks and now just stopped working. All the other code I have works, including my expand section with non-table text. The table is now not working.
Did something change or anyone have ideas on how to get this working like it was 2 days ago?

1 answer

0 votes
Kyle Long
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2024

Hi,

It looks like your code is attempting to transform a pandas data frame into an html format and you are using this to make an api requests that are responding with "BadRequest". There could be a multitude of causes here, to narrow down the issue can you share an example of the api request with a sample of the contents(with dummy data)? (I would like to reproduce and find precisely what syntax is failing and check for api changes)

- Kyle

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events