Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello Confluence Experts,
I have a use case wherein I need to import a MS Excel data into Confluence.
One excel row needs to be created as one new page and columns in that excel needs to mapped/linked to another existing static pages in the the same Confluence space.
By reading some Confluence docs, I got to know that I might need to create a new custom User Macro to perform this import.
Can any expert guide me further Or if someone working on similar macro help me out to do it fast?
Thanks in advance.
this is a main part of creating a new page in confluence
mypage = {"type":"page","title":""+NEWPAGENAME+"","ancestors":[{"id":PARENTID}],"space":{"key":""+SPACEKEY+""},"body":{"storage":{"value":"" + PAGE_IN_STORAGE_FORMAT+ "", "representation": "storage"}}}
post = requests.post(url+'/rest/api/content/', data=json.dumps(mypage), auth=auth, headers=headers, verify=False)
newpageId = json.loads(post.text)['id']
You need auth and headers:
headers = {
'X-Atlassian-Token': 'no-check',
'Content-Type': 'application/json'
}
auth=(user, password)
This is written in python
Regards, Dominic
You do not need a user macro for this.
What you need is a script (Python or something else) which uses the REST API from confluence to create the pages.
All about REST API is here: https://docs.atlassian.com/ConfluenceServer/rest/7.16.2/
You will need the Create Content section.
Regards, Dominic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your valuable suggestion.
Do you have any sample script calling Content creation APIs of Confluence?
If yes, that would be really great.
Thanks..!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.