you can make rest api calls from coach views also as xhr requests e.g. the following in the load section will retrieve the user profile image via rest api call
var _this = this;
var imagehtml;
var imgheight = 60;
var imgwidth = 60;
var userName = "current";
if (this.context.binding){
userName = this.context.binding.get("value");
}
if (this.context.options.imageHeight){
imgheight = this.context.options.imageHeight.get("value");
}
if(this.context.options.imageWidth){
imgwidth = this.context.options.imageWidth.get("value");
}
var xhrArgs = function(config) { return {
url: "/rest/bpm/wle/v1/avatar/" + userName, content: {
accept: "application/json"
},
load: displayImage,
handleAs: "json"} };
try{
deferred = dojo.xhrGet(xhrArgs ( { inputs: {}}));
} catch (error) {
alert(error);
}
function displayImage(json_results) {
imagehtml = "<img height='" + imgheight + "' width='" + imgwidth + "' src='data:image/jpeg;base64," + json_results.data.userAvatarImage + "' />";
var imgDiv = _this.context.element.getElementsByTagName("div")[0];
var nameDiv = _this.context.element.getElementsByTagName("div")[1];
imgDiv.innerHTML = imagehtml;
nameDiv.innerHTML = json_results.data.userName;
}