Closed leesilver closed 7 years ago
꼭 답변해 주시기 바랍니다. 감사합니다.
api 요청 url을 확인하셨으면 합니다. https://github.com/plusfriend/auto_reply#5-api-specifications /keyboard/message 형태는 없어서 이부분이 잘못된것으로 보입니다.
안녕하세요. 말씀하신 부분 이미 진행된것으로 확인되었습니다. 하지만 역시 안되고 있습니다.
하기 코드 참고하시고 문제점 확인해주시기 바랍니다.
site http://t.activity.efun.com /**
@throws Exception */ @RequestMapping(value={"keyboard"}) public void test(HttpServletRequest request,HttpServletResponse response) throws Exception {
JSONObject object = new JSONObject();
/**
* add button list
*/
List<String> strs = new ArrayList<>();
strs.add("hehe");
strs.add("hehe2");
strs.add("hehe3");
/**
* type is button
*/
object.put("type", "buttons");
object.put("buttons", strs);
/**
* write data to client
*/
writeBackJson(object);
} /**
@throws Exception */ @RequestMapping(value={"keyboard/message"}) public void testMessage(HttpServletRequest request,HttpServletResponse response) throws Exception {
logger.info("kakao testMessage");
/**
* get params of request,There is no parameter here
*/
Map<String,String[]> map=request.getParameterMap();
logger.info("request message :" +JSON.toJSONString(map));
JSONObject object = new JSONObject();
/**
* and return type text
*/
JSONObject message = new JSONObject();
message.put("text", "hahaha");
/**
* and return type buttons
*/
JSONObject keyboard = new JSONObject();
String[] buttons = new String[]{"hehe1","hehe2","hehe3"};
keyboard.put("type", "buttons");
keyboard.put("buttons", buttons);
object.put("message", message);
object.put("keyboard", keyboard);
/**
* write data to client
*/
writeBackJson(object);
}
답변부탁합니다.
@leesilver 구현에 대한 도움은 저희가 드릴 수 없어요. 양해 부탁드려요.^^;
안녕하세요.
자동응답 API로 테스트 시 userkey와 유저가 선택한 명령어를 획득할수 없습니다. http://t.activity.efun.com/keyboard/message
확인부탁합니다. 감사합니다.