How to add special fields to a confluence page with Rest API - wiki


I am using the content/post api to create a new confluence page. It works just fine. Unfortunately the api doesn’t support creating a new page out of an existing template… I can easily create a content with headers and a table, and I know how to inject html content.

But the issue is: I didn’t find any solution online to create more complex content. Specically: a date field (I want it to be presented the same way a date field is presented when you manually create it by ‘//’ - it is presented as a formatted date, and if you edit the document - you can edit it through a “date picker” -choosing from a calendar).

Also I want to add “instructional text” field (this is the name when creating a template manually) - text that appears only on edit mode (some descriptions for each section, that don’t appear on the doc it self, but do appear on edit - like a placeholder), and don’t know how I can do it through the api.

My current json body (Which works fine for these simple types) is:

  body: {
    wiki: {
      representation: "wiki",
      value: "h1. some title name h1. another title ||tableCol||anothertablecol||.... {html}<somehtmltag />{html}"

How can I add a date field (date picker) and an instructional text, and perhaps more field types (creating a section, etc… anything that I can do when creating a page manually). Didn’t find any relevant real documentation for the wiki representation syntax.

Thanks in advance