package hello;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/webhook")
public class HelloWorldController {

    @RequestMapping(method = RequestMethod.POST)
    public @ResponseBody WebhookResponse webhook(@RequestBody String obj){
        String text="";
try{
        
        JSONObject objS = new JSONObject(obj);
//          System.out.println(objS.get("id"));
          JSONObject result = objS.getJSONObject("result");
          text = result.getString("resolvedQuery");
        System.out.println(text);
}catch(Exception e){}
        return new WebhookResponse(text, text);
    }
}

@@ -514,17 +514,16 @@
 %0A       
- 
 String t
@@ -529,35 +529,28 @@
 text
-=%22%22;%0Atry%7B%0A        %0A    
+ = null;%0Atry%7B%0A%09
     
+%09
 JSON
@@ -702,16 +702,17 @@
         
+ 
 text = r
@@ -757,56 +757,86 @@
     
-System.out.println(text);%0A%7Dcatch(Exception e)%7B%7D%0A
+    %0A          %0A%7Dcatch(Exception e)%7B%0A%09text = %22last ctach%22+e.getMessage();%0A%7D%0A%0A%09
     
@@ -866,16 +866,17 @@
 esponse(
+ 
 text, te
@@ -880,16 +880,17 @@
  text);%0A
+%09
     %7D%0A%7D%0A

Update HelloWorldController.java