Stephen, thank you so much for all your sharings of real examples and how to’s!
I want to add my two cents If you need only simple API call from scripting task, you may reach that by calling internal HTTP connector as shown below. In this case you do not have to add any library to classpath.
in JavaScript script task:
var httpConnector = org.camunda.connect.Connectors.http()
var resp = httpConnector.createRequest()
.get()
.url("http://<host>:[<port>]/artefacts/"+execution.getVariable('artefactId'))
.execute()
var result = resp.getResponse()
resp.close()
execution.setVariable('responseBodyString', result)
Here we call Java HTTP connector class from JS, so we might use the scenario from official docs for POST, add headers and so on:
https://docs.camunda.org/manual/7.8/reference/connect/http-connector/#create-a-simple-http-request
regards,
dmitry