
Hello,
I am trying to get the knowledge base article's content, but the WEB api doesn't return the content in html format with tags, any help please?
I am using CRM Rest builder of jlattimer
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/knowledgearticles(MyGuid)?$select=content", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var content = result["content"];
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
]
Thank you
*This post is locked for comments
I have the same question (0)What result do you get if you append /api/data/v8.2/knowledgearticles(MyGuid)?$select=content to your organization url in a web browser? (like org.crm4.dynamics.com/.../knowledgearticles(MyGuid)$select=content)