Set font-size via api content

Pawel Marciniak June 11, 2021

Hello,

I am creating a content of a page using content api but I am not able to set a font size.

Example request:

{
"id": "123456789",
"type": "page",
"status": "current",
"title": "test123",
"version": {
"number": 78
},
"body": {
"storage": {
"value": "<p style=\"font-size: 10px\">test1</p>",
"representation": "storage"
}
}
}

I also tried:
"<p style=\"font-size: 10em\">test1</p>
"<p style=\"font-size: 10%\">test1</p>"

 

Whatever I do, the font size is 1em.

I see that other styles ex. text-align works fine.

Is there any way to set a font size? How can I know which styles works fine and which dont?

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2021

Hi Pawel,

Thank you for raising this with us! I hope you are doing well.

Confluence Cloud doesn't support different font sizes, so updating it using the API isn't possible.  You can try using the various formatting options mentioned in Insert Confluence Wiki Markup.

I'll refer you to an earlier discussion on the topic below:

I refer to the feature request CONFCLOUD-46077 (Ability to adjust font size). You can vote and follow that request if you want updates on that.

I hope that helps, but let me know if you have any questions.

Take care,

Shannon

Pawel Marciniak June 17, 2021

@Shannon S Thank you for the response.

I am wondering - when I create page content via API(https://SERVER.atlassian.net/wiki/rest/api/content/) can I set a heading size for a text?

 

I tried, but it didnt work:

2021-06-17_16h37_05.png

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2021

Hi Pawel,

Can you show us the example REST call that you tried and the output? In the page REST API examples, you can learn how to convert the Wiki markup format.

There's also a thread at the Atlassian Developer Community, Create a page Confluence REST API, and there's an example there that shows adding an h1 heading.

I hope that helps, but please let me know if you have any trouble.

Shannon

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events