Good afternoon,
So we're trying to figure out how to create an evaluation using the Platform SDK for JavaScript. The docs present very little information on the required object structure for "body". In the example, it just says let body = {}; // Object | evaluation
(not IEvaluation or something like that, no link to the object/interface provided) and the table listing parameters just says body is just of type "object" with a description of "evaluation". Unfortunately, these little one-word "descriptions" don't really tell us anything about the nature of what is actually required. Below is some code I was able to guess out, in case it helps anyone else in the same boat:
// "quality" here is a platform.QualityApi or whatever that object is called
var guess;
(async function() {
guess = await quality.postQualityConversationEvaluations("a conversation ID", {
agent: "The user ID of an agent",
evaluator: "The user ID of the evaluator",
formId: "Incorrect. It wants a form ID (tried form, formId, formID, agentFormId and several other variations)"
}, {
expand: "evaluatorId" // (I think that was what the intended meaning, that if we put it here we'll also get the evaluator's ID? Doesn't really make sense considering we had to pass it as a parameter but whatever)
});
console.clear();
console.log(guess);
})();
This one, unlike other API endpoints, doesn't want an object containing an object labeled "body" (like for some you have to do { body: { ... }}
). This is currently all that is known (by our organization) about how this is supposed to work. Clearly there are some (undocumented? Documented elsewhere?) missing puzzle pieces... I'm going to assume we're just looking in all the wrong places (I'm starting to think I might have a link to an outdated version of the docs or something), but even so any info would be greatly appreciated. Thanks!