Skip to content

Postman Doc for Confluence Documentation

Pratik sharma edited this page Oct 19, 2022 · 1 revision

Welcome to the Postman-Doc wiki!

Things you will learn in this wiki, doc

  • How to Create a styled page in confluence with the REST API
  • Using Atlassian built-in macros while creating Pages.
  • How to use Storage Format?

TL;DR: Everything I learnt while building this app.

How to view Storage format in your Confluence Page ?

  • Select a page you want the storage view of.
  • Click More Action(three dots) - Advanced details - Storage format
Screenshot 2022-10-19 at 5 33 26 PM

How to send API Requests to Confluence To Create page?

import api, {route} from "@forge/api";

const jsondata = {"type":"page",
 "title":title,
 "space": {"key": "COOLHEAD" }, // your space key can be accessed by useProductContext hook 
 "body": {
  "storage": {
    "value":  name,
    "representation": "storage"
  },
 }  
     }



const response = await api.asApp().requestConfluence(route`/wiki/rest/api/content`, {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body:JSON.stringify(jsondata),
});