import xmlrpclib
if __name__ == '__main__':
proxy = xmlrpclib.ServerProxy('https://wiki.oicr.on.ca/rpc/xmlrpc')
#get authentication token
auth = proxy.confluence1.login('user name', 'password')
#get parent page 'sandbox' in 'BCF' space
parent = proxy.confluence1.getPage(auth, 'BCF', 'sandbox')
#Crate a page called 'Test' under 'sandbox'
page = {'space':'BCF', 'title':'Test', 'parentId':parent['id'], 'content':'This is a test page for Confluence XML-RPC v1.'}
result=proxy.confluence1.storePage(auth, page)
#update this page
result['content'] = 'This is a test page for Confluence XML-RPC v1. version 2'
result = proxy.confluence1.updatePage(auth, result, {'minorEdit':False})
print result
proxy.confluence1.logout(auth)
Reference: https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home