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;
import org.json.JSONObject;

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

    @RequestMapping(method = RequestMethod.POST)
    public @ResponseBody String webhook(@RequestBody String obj){
       String text = null;
       String source = null;
       String name=null;
       String respostring=null;
       String text1=null;
       String rescode_str=null;
try{
	    	JSONObject objS = new JSONObject(obj);
//          System.out.println(objS.get("id"));
          JSONObject result = objS.getJSONObject("result");
	        text = result.getString("resolvedQuery");
	  JSONObject originalRequest = objS.getJSONObject("originalRequest");
	        source = originalRequest.getString("source");
	JSONObject data = originalRequest.getJSONObject("data");
	JSONObject user = data.getJSONObject("user");
	        name=user.getString("name");

	        text1="I love India";
	      //  int rescode=authorize();
	    //    rescode_str=String.valueOf(rescode);//Now it will return "10"  
           
            
	    
          
}catch(Exception e){
	text = "last ctach"+e.getMessage();
}

	       return  "{speech: "+rescode_str+",displayText: "+rescode_str+", source: biz-webhook-sample}";
	       //return  "{speech: "+text+" source "+source+",displayText: "+text+", source: biz-webhook-sample}";
	    }
	
	
}

@@ -1449,27 +1449,20 @@
 eech: %22+
-rescode_str
+name
 +%22,displ
@@ -1471,27 +1471,20 @@
 Text: %22+
-rescode_str
+name
 +%22, sour

Update HelloWorldController.java