Retrieve internal Task Id from External Task

Hey,

I’m trying to make a REST call to this endpoint, while executing my fetched external task Get Local Task Variables | docs.camunda.org. But when I enter the ID I received from org.camunda.bpm.client.task.ExternalTask#getId() or org.camunda.bpm.client.task.ExternalTask#getActivityInstanceId() the Engine throws this exception:

org.camunda.bpm.engine.exception.NullValueException: task c20429a7-475b-11ea-92b9-00ff29e821a6 doesn't exist: task is null

How am I supposed to refer to my task from outside?