0 votes
181 views
in REST API by

1 Answer

0 votes
by (240 points)
Technically possible from server scripts using live connect ,however it is tedious.From the services use HTTP connector to make server side REST API calls(available from SYSDATA toolkit).

--Mahesh
by (11.7k points)
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;
}

Related questions

0 votes
0 answers 34 views
0 votes
0 answers 46 views
0 votes
1 answer 101 views
0 votes
1 answer 100 views
0 votes
0 answers 49 views
0 votes
0 answers 32 views
asked May 16, 2016 in REST API by anonymous
0 votes
0 answers 31 views
0 votes
1 answer 62 views
0 votes
0 answers 40 views
0 votes
2 answers 80 views
0 votes
2 answers 185 views
0 votes
0 answers 3 views
0 votes
1 answer 132 views
0 votes
1 answer 141 views
asked May 16, 2016 in REST API by BPM Tips Admin (11.2k points)
0 votes
0 answers 34 views

515 questions

423 answers

81 comments

1.6k users

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
...