Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Send diagram in Mermaid syntax via api to Confluence page

Beata Malczewska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 6, 2025

I have uml diagram in Mermaid syntax as simle as this:

classDiagram class Animal { +String name +int age +makeSound() } class Dog { +String breed +bark() } class Cat { +String color +meow() } Animal <|-- Dog Animal <|-- Cat

Is there any way to send it in body request to the API so it was visible in Confluence page as diagram not as plain text?

I send request to 

me.atlassian.net/wiki/api/v2/pages

with body

 

{
  "spaceId": "11111",
  "status": "current",
  "title": "Title",
  "parentId": "11111",
  "body": {
    "representation": "storage",
    "value": "classDiagram\n    class Animal {\n        +String name\n        +int age\n        +makeSound()\n    }\n\n    class Dog {\n        +breed: String\n        +bark()\n    }\n\n    class Cat {\n        +color: String\n        +meow()\n    }\n\n    Animal <|-- Dog\n    Animal <|-- Cat"
  }
}
I have plugin installed, but see diagram as plain text on created page.

2 answers

0 votes
Igor Medeiros - Modus Create
Atlassian Partner
April 7, 2025

Hi @Beata Malczewska

Could you please clarify which app you refer to?

 

Thanks,
Igor Medeiros

0 votes
marc -Collabello--Phase Locked-
Community Champion
April 6, 2025

Hi @Beata Malczewska ,

You'd need to contact the plugin vendor to ask them how they store the Mermaid diagram.  It is likely not directly stored as text on the page.

You'd hope they offer an API for sending Mermaid from external systems.

Suggest an answer

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

Atlassian Community Events