Rest Service Call From Javascript Script

I want to call a REST service from a javascript external resource in camunda bpmn but I can’t find a way to make the http request from within the script. I don’t want to use the http connector and service task.

Can this be done in camunda?

If you script is placed in the bmp modell, it will be executed on the server so you can try:

var resourceURL = new"");

var urlConnection = resourceURL.openConnection();
var inputStream = new
var bufferedReader = new;
var inputLine =""
var text="";
while ((inputLine = bufferedReader.readLine()) != null) {

//.... do somthing with the text

Hi @abdallah,

I am not sure I get your question, where REST service should be called from? Could you be a bit more specific about it?


I already have my api. I want to make an api call from the script(javascript) in a task script.
How can i choose the request url and method and set authorization.

well, in that case I think @Robert_Ottohall has a valid suggestion to solve your problem.

Hope that helps,

Thanks!This worked well for me.

Hi @Robert_Ottohall,

How can I add method like POST, GET… etc…? And also, how can I add input parameters to it.?

Nihir Shah