How is the proper way to use the Cisco CompressedClientLog Finesse API?

Viewed 51

How can I best format my POST request for the Cisco API CompressedClientLog? 

https://developer.cisco.com/docs/finesse/#!compressedclientlog%e2%80%94post-compressed-log-to-finesse/compressedclientlogpost-compressed-log-to-finesse

CompressedClientLog—Post Compressed Log to Finesse

var data = new FormData();
var logObj = '<ClientLog><logData>This is some logged data for the log file</logData></ClientLog>';
data.append("logData", logObj);

var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log("Gadget is now engaged" + this.responseText);
  }
});
xhr.open("POST", "https://finesse1.xyz.com/finesse/api/User/finadmin/CompressedClientLog");
xhr.send(data);

Response is:

<ApiErrors>
  <ApiError>
    <ErrorType>Parameter Missing</ErrorType>
    <ErrorData>logData</ErrorData>
    <ErrorMessage>Missing logData in the ClientLog object</ErrorMessage>
  </ApiError>
</ApiErrors>

Where am I going wrong?

0 Answers
Related