Camunda Platform 8 SaaS - Rest API Call, Token Not Moving

Hi all,

I am trying to make an API call using the Rest Connector to this free api (just for testing):
https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita

Issue is that the Connector doesn’t seem to execute, and the token just stays at the task (in green).
An incident has not been created.

I am using the Camunda 8 SaaS platform on a 30 day trial.

Thanks.

Hi Hob,
can you please share some more info about how you configured your connector?
Or share your bpmn diagram so we can try to replicate the issue?
Thanks!
Enrico

Hi Hob,
it’s me again,
I’ve just tested your interesting endpoint (I love cocktails :grinning:)
It works, here you are the parameters you should use in the rest connector:

url: https://www.thecocktaildb.com/api/json/v1/1/search.php

query parameters:

{s:“margarita”}

Then you can set a variable for the result, give the name you want.

you can also filter the response with the result expression field.
For example I’ve used the following expression:

{
  drinks: response.body.drinks,
  firstDrink: response.body.drinks[1].strCategory
}

In the documentation you can find all the needed information:

Have a good rest!
Enrico

Hi Enrico,

Thanks for the info on this. So what I did in the end was to delete the cluster and create a new one. The connector call worked after that!

I just have a question in terms of error handling.

In the Error Handling section, I have this Error Expression:

if error.code != “200” then
bpmnError(“apiFailed”, error.code + “-” + error.message)
else
null

This BPMN Error is then handled as an error boundary event, and routed to another a user task.

Question is how do I get the error code and message from the bpmn error, so that this info can be presented to the user.

Thanks.

Hi,
today it’s not possible with Camunda 8 to define te error variables in the catch error event.
The only item to configure in the catch error event is the global error reference.
The error variable will be introduced in a next release.
As a workaround you can define a process variable in your worker, and get the process variable in the process.
Cheers,
Enrico