Using Tampermonkey, I want to create a wiki page in an existing wiki in HCL Connections 6.6. According to the documentation, I build this function:
function createWikiPage(cnxBase) {
let wikiLabel = 'API Test Wiki'
let url = `${cnxBase}/wikis/basic/api/wiki/${wikiLabel}/feed`
let body = `
<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text">Matt's Page6</title>
<summary type="text">My test</summary>
<content type="text">This is James's wiki page.</content>
<category term="wikipagetag1" />
<category term="wikipagetag2" />
<category term="wikipagetag3" />
<category scheme="tag:ibm.com,2006:td/type" term="page" label="page" />
</entry>
`
let args = {
method: "POST",
url: url,
data: body,
headers: {
"Content-Type": "application/atom+xml"
},
onload: function(response) {
alert(response.status + ' ' + response.responseText);
}
}
GM_xmlhttpRequest(args)
}
The wiki page with tags got created after calling createWikiPage('https://cnx-host')
but without any content. Also when I edit the page in the browser and switch to html sourcecode I can't see any character in the content.
Why the official example doesn't work?