You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I have some process when I programmatically generate draw.io diagrams and then I need to paste these diagrams to the Confluence page. I suppose to use API only.
I realized how I can insert a diagram on page, but before I need to have it in draw.io plugin search.
So, my question about importing - how I can execute using API of Confluence the same action as import diagrams from diagram editor:
- add draw.io macro to the page, then click 'Edit' to launch the diagram editor.
- From there you go File -> Import.
- The XML you are importing needs to be a draw.io diagram.
Hi Daria,
If you already have the diagram file, you just need to upload it to a page or blog post. You can use the rest endpoint for that. Attachment's content type needs to be "application/vnd.jgraph.mxfile" so search can pick it up.
Boris.
It works, thank you.
My example of code on Python:
url = CONFLUENCE_BASE_URL+'/rest/api/content/'+CONTENT_ID
headers = {"X-Atlassian-Token": "nocheck"}
files = {'file': ('diagram.drawio', open('tmp/diagram.drawio', 'rb'), 'application/vnd.jgraph.mxfile')}
requests.post(url+'/child/attachment', data=data, auth=('user', 'password'), files=files, headers=headers)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond. A long time favorite, Team Cale...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.