Unable to get response from Redmine API


I’m working on a project to integrate Camunda with Redmine, an open-source project management application.

I tested the API using postman and I’m getting a response there but when I implement the http-connector for the same request and map the output to ${response}, I’m getting a blank value in the response variable, confirmed this by logging using a JavaScript external task worker.

I rechecked everything including url, method, headers, the Auth key etc. I also tried with a different public API and I could see the JSON output in logs, using the same code. But as soon as I changed it with the Redmine URL, the response string is blank.

What am I missing?

I’m attaching a test BPMN below, it includes the URL and Auth key.

This is the code in the external worker:
const { Client, logger } = require(‘camunda-external-task-client-js’);
const open = require(‘open’);

const config = { baseUrl: 'http://localhost:8080/engine-rest', use: logger, asyncResponseTimeout: 10000 };

const client = new Client(config);

client.subscribe('logger', async function({ task, taskService }) {

  const redmine_response = task.variables.get('redmine_response');

  console.log(`Response -> ${redmine_response}`);

  await taskService.complete(task);

redmine-api-test.bpmn (3.6 KB)

After lots of headbanging, found the issue :sweat:. The Redmine API accepts the auth key only as part of URL params and not headers.

1 Like

Thanks a lot for posting the solution :slight_smile:
Hopefully all that head banging will mean someone else might get through the same problem with a lesser concision.

1 Like