I'm currently able to update my confluence wiki page using python script like follows:
import sys
from xmlrpclib import Server
s = Server("https://my.wiki.root/rpc/xmlrpc")
token = s.confluence2.login("user", "passwd")
page = s.confluence2.getPage(token, "WIKI SPACE", "page")
page["content"] = '<xml content>'
s.confluence2.storePage(token, page)
[credits to Atlassian's Confluence XML-RPC and SOAP APIs]
But I can't install Python (I don't know much about this great language) on my PC, and I wondered if I could do it (nearly) as easily with Excel. I'm trying this:
Sub updatePage()
Dim URL As String, myXML As String
Dim xmlHttp As Variant
Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
myXML = "<my xml>"
URL = "https://my.wiki.root/rpc/xmlrpc"
xmlHttp.Open "POST", URL, False
#' I specify my content type
xmlHttp.SetRequestHeader "Content-Type", "text/xml"
#' Here I'm less and less sure
xmlHttp.send "pageId=248091993&editorFormat=" + myXML
#' This is void...
MsgBox xmlHttp.responseText
End Sub
I just get nothing in responseText
. I don't know where to look.
s
structure returned in python with Server("xmlrpc URL")
I would've won! But what is it? How do I get it with Excel?You should try to login in your VBA code.
You do it in the Python, but why don't you in th VBA?
e.g.
URL = "my.wiki.root/rpc/xmlrpc?id=user&pwd=passwd";
This should fix your issue.