REST API to get id of variable instance

Hello!
I’m implementing custom UI for user tasks and there is a need in viewing attached files created as a variables in previous steps. In the Camunda cockpit I see the file and can download it. So, file is there. To dowinload it with REST API following call may be executed: variable-instance/{variable_instance_id}/data and also works.
But the question is where actually to get value of variable_instance_id? Response of the REST call to task/{task_id}/variables doesn’t contain id of the variable instance.

BR
Oleg L.

Found the way! Buy anyway two calls to the same API are needed.

  1. Call to variable-instance?processInstanceIdIn={process_instance_id_in}&variableName={variable_name} to retrevie variable_instance_id
  2. Using variable_instance_id call to variable-instance/{variable_instance_id}/data