Http-Connector -> Body to Variable

I have a script-task using the HTTP-Connector that requests a specific url.
Now I want to write some Response-Properties to the camunda-workflow variable…

My expected response body:

    id: 'some-guid'

I want to write the id to the documentId variable:

How do I archive that?

And how to handle getting a date?

Update (22.03.2022)

I found in a forum following snippet to add in connector tab under output parameters:

var response = connector.getVariable("response");
var json = S(response);
var deadlineProp = json.prop("deadline");

But then I get following error:

org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script:org.camunda.spin.spi.SpinDataFormatException: SPIN-01004 No matching data format detected
	at org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.evaluate(
	at org.camunda.bpm.engine.impl.scripting.ExecutableScript.execute(
	at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(
	at org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(
	at org.camunda.bpm.engine.impl.delegate.ScriptInvocation.invoke(
	at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(

How can I fix it?

Hi Zott,
Is connector.getVariable(“response”) returns a JSON string ? If it json string then you wont get that exception.