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)
expand_section3 = create_expand_section('Expand to view Data in the last 3d', table3)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.