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 https://docs.camunda.org/manual/7.7/reference/rest/task/local-variables/get-local-task-variables/. 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?