Failed to evaluate expression in HTTP Connector Camunda 8

Failed to evaluate expression ‘={ result:response.body.main}’

Any Explaination to this, I just need only body to be shown in this variable.

ResponseEntity
This is a return class where ResponseModel is class in SpringBoot so it automatically converted into JSON format.

If I don’t use any expression in response then result is
{“status”:200,“headers”:{“date”:“Wed, 10 Aug 2022 11:05:17 GMT”,“expires”:“0”,“ngrok-trace-id”:“47a3701259067da4832518529e18d183”,“transfer-encoding”:“chunked”,“x-content-type-options”:“nosniff”,“x-xss-protection”:“1; mode=block”,“vary”:[“Origin”,“Access-Control-Request-Method”,“Access-Control-Request-Headers”],“x-frame-options”:“DENY”,“content-type”:“application/json”,“cache-control”:“no-cache, no-store, max-age=0, must-revalidate”,“pragma”:“no-cache”},“body”:{“status”:“SUCCESS”,“message”:"Message published successfully. ",“data”:{“messageKey”:“4503599627408756”}}}

I just need body of this response not entire details so what must be expression that works here.

Your JSON looks like

{
     "status":200,
     "headers":{
         "date":"Wed, 10 Aug 2022 11:05:17 GMT",
         "expires":"0",
         "ngrok-trace-id":"47a3701259067da4832518529e18d183",
         "transfer-encoding":"chunked",
         "x-content-type-options":"nosniff",
         "x-xss-protection":"1; mode=block",
         "vary":["Origin","Access-Control-Request-Method","Access-Control-Request-Headers"],
         "x-frame-options":"DENY",
        "content-type":"application/json",
         "cache-control":"no-cache, no-store, max-age=0, must-revalidate",
         "pragma":"no-cache"
     },
     "body":{
          "status":"SUCCESS",
          "message":"Message published successfully. ",
          "data":{
               "messageKey":"4503599627408756"
          }
     }
}

I don’t see a “main” in your “body”

So… what happens if you put the expression as:

={ result:response.body}
1 Like