Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to store data entered in the HTML Macro

I create a simple HTML, JS code, embedded via the HTML Macro.
The user is supposed to enter some data, what works like charm.

How can I store this data server-side to ensure that is available the next time, the user opens this space.

thank you


1 answer

0 votes

Hello Stefan,

Your question is a great question and it points to how versatile Confluence is capable of being. Within the HTML macro itself, you will need to use PHP within there to make API calls to endpoints to ingest the inserted data. There are multiple guides that will walk you through on how to use PHP and a REST API together. A great and detailed guide may be found at How To Create A Simple REST API in PHP? Step By Step Guide!

Along with this, there is a guide on how to use PHP within Confluence using the HTML macro. That guide may be found at How to use PHP inside Confluence pages.

I hope this proves helpful and you’re able to start ingesting some of your user content via the REST API.

Stephen Sifers

Hoi Stephen,

thanks for pointing me in the PHP direction but that requires not little work(around) to get it done. Isn't there any possibility to make use of Confluence's APIs?

Hello Stefan,

HTML by itself does not directly work with REST API POST/PUT calls due to the requirements of authentication. With this said, you will need to use something such as PHP to allow for triggers which then authenticate and make the authenticated REST API calls to Confluence (Or any other service you want to update).

Another alternative would be to use Javascript, but the entry point for PHP is simpler than Javascript. Mainly due to simplified working examples of how to make REST API calls with PHP readily available.

Stephen Sifers

I agree that PHP could be simpler in the long term but JS can be inlcuded easily, PHP needs an extra server.


This is good information, but do we need to have PHP installed in the Confluence Server? It seems that with JS we might not need to install anything extra in the server itself. Please let me know if I am incorrect here.

Thank you,


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

219 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you