테스트 페이지 완료

This commit is contained in:
hehihoho3@gmail.com 2025-09-29 18:31:08 +09:00
parent b3eb056fa8
commit 3867cc7590
14 changed files with 422 additions and 385 deletions

View File

@ -135,18 +135,18 @@
</div> </div>
<div class="mem_cont_in"> <div class="mem_cont_in">
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*메시지ID <div class="input_left">*메시지ID

View File

@ -149,18 +149,18 @@
</div> </div>
<div class="mem_cont_in"> <div class="mem_cont_in">
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="12e749877379aa7426275414050694b953" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">페이지번호 <div class="input_left">페이지번호
@ -174,7 +174,7 @@
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">조회시작일자 <div class="input_left">조회시작일자
<input type="text" class="list_inputType1" id="startDate" maxlength="100" value="" size="100"/>(기본값 오늘)ex)20230601 <input type="text" class="list_inputType1" id="startDate" maxlength="100" value="" size="100"/>(기본값 전체)ex)20230601
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">

View File

@ -24,12 +24,6 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요 //회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용 //실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api key
//테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
//String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
/******************** 전송요청 URL ********************/ /******************** 전송요청 URL ********************/
@ -42,8 +36,8 @@
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
/******************** 인증정보 ********************/ /******************** 인증정보 ********************/
params.put("mberId", mberId); //문자온 로그인 아이디 String p_mberId = request.getParameter("p_mberId"); //발신자 번호
params.put("accessKey", apiKey); //APIKEY String p_apiKey = request.getParameter("p_apiKey"); //수신자 번호
/******************** 전송정보 ********************/ /******************** 전송정보 ********************/
//(선택) //(선택)
@ -54,6 +48,8 @@
String p_testYn = request.getParameter("p_testYn"); //테스트데이터여부 '', 'YF', 'YS' String p_testYn = request.getParameter("p_testYn"); //테스트데이터여부 '', 'YF', 'YS'
//추가 전송 데이터 //추가 전송 데이터
params.put("mberId", p_mberId); //회원 아이디
params.put("accessKey", p_apiKey); //인증키
params.put("page" , p_page); //페이지번호 params.put("page" , p_page); //페이지번호
params.put("pageSize" , p_pageSize); //페이지당 출력갯수 params.put("pageSize" , p_pageSize); //페이지당 출력갯수
params.put("startDate" , p_startDate); //시작일자 params.put("startDate" , p_startDate); //시작일자

View File

@ -95,18 +95,19 @@
</div> </div>
<div class="mem_cont_in"> <div class="mem_cont_in">
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<!-- 채널ID 조회 설명 및 입력 영역 끝 --> <!-- 채널ID 조회 설명 및 입력 영역 끝 -->
<div class="mem_btnWrap2"> <div class="mem_btnWrap2">

View File

@ -20,10 +20,6 @@
final String encodingType = "UTF-8"; final String encodingType = "UTF-8";
final String boundary = "____boundary____"; final String boundary = "____boundary____";
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용
//실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api key
//테스트용 //테스트용
//String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디 //String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
@ -32,11 +28,16 @@
/******************** 전송 요청 URL ********************/ /******************** 전송 요청 URL ********************/
final String apiUrl = "http://119.193.215.98:8087/api/kakao/inqry/chnlId"; //채널ID 조회 API URL final String apiUrl = "http://119.193.215.98:8087/api/kakao/inqry/chnlId"; //채널ID 조회 API URL
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용
String p_mberId = request.getParameter("p_mberId"); //발신자 번호
String p_apiKey = request.getParameter("p_apiKey"); //수신자 번호
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
//기본 전송 데이터 //기본 전송 데이터
params.put("mberId", mberId); //회원 아이디 params.put("mberId", p_mberId); //회원 아이디
params.put("accessKey", apiKey); //인증키 params.put("accessKey", p_apiKey); //인증키
//REST API 전송 //REST API 전송
String result = ""; String result = "";

View File

@ -83,18 +83,18 @@
</div> </div>
<div class="mem_cont_in"> <div class="mem_cont_in">
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<div class="mem_btnWrap2"> <div class="mem_btnWrap2">
&nbsp;<button type="button" class="mem_btn3" style="width: 100%;" id="ajax_select_price" onclick="return false;">발송가능건수 요청</button> &nbsp;<button type="button" class="mem_btn3" style="width: 100%;" id="ajax_select_price" onclick="return false;">발송가능건수 요청</button>

View File

@ -24,8 +24,6 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요 //회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용 //실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api ke
//테스트용 //테스트용
@ -43,9 +41,14 @@
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
String p_mberId = request.getParameter("p_mberId"); //발신자 번호
String p_apiKey = request.getParameter("p_apiKey"); //수신자 번호
/******************** 인증정보 ********************/ /******************** 인증정보 ********************/
params.put("mberId", mberId); //문자온 로그인 아이디 params.put("mberId", p_mberId); //문자온 로그인 아이디
params.put("accessKey", apiKey); //APIKEY params.put("accessKey", p_apiKey); //APIKEY
/******************** 전송정보 ********************/ /******************** 전송정보 ********************/
String result = ""; String result = "";

View File

@ -2,155 +2,155 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko"> <html lang="ko">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>알림톡 발송(샘플-문자온)</title> <title>알림톡 발송(샘플-문자온)</title>
<script type="text/javascript" src="./jquery-3.5.0.js"></script> <script type="text/javascript" src="./jquery-3.5.0.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
// ===== 전역 설정: multipart로 보낼지 여부 (기본: x-www-form-urlencoded) ===== // ===== 전역 설정: multipart로 보낼지 여부 (기본: x-www-form-urlencoded) =====
var USE_MULTIPART = false; // 서버가 multipart/form-data만 받으면 true로 바꿔 var USE_MULTIPART = false; // 서버가 multipart/form-data만 받으면 true로 바꿔
// ===== 클릭 바인딩 (중복 방지) ===== // ===== 클릭 바인딩 (중복 방지) =====
$("#ajax_send_at").off("click").on("click", function(){ $("#ajax_send_at").off("click").on("click", function(){
// 결과 초기화 // 결과 초기화
$("#msgGroupId,#resultCode,#resultMsg,#successCnt,#failCnt").text(""); $("#msgGroupId,#resultCode,#resultMsg,#successCnt,#failCnt").text("");
// 페이로드 생성 // 페이로드 생성
var payload = buildPayload(); var payload = buildPayload();
console.log("[SEND PAYLOAD]", payload); console.log("[SEND PAYLOAD]", payload);
if (USE_MULTIPART){ if (USE_MULTIPART){
// multipart/form-data // multipart/form-data
var fd = new FormData(); var fd = new FormData();
Object.keys(payload).forEach(function(k){ fd.append(k, payload[k]); }); Object.keys(payload).forEach(function(k){ fd.append(k, payload[k]); });
$.ajax({ $.ajax({
url: "./jsp_example_send_at_r1.jsp", url: "./jsp_example_send_at_r1.jsp",
type: "POST", type: "POST",
data: fd, data: fd,
processData: false, processData: false,
contentType: false, contentType: false,
dataType: "json", dataType: "json",
success: handleSuccess, success: handleSuccess,
error: handleError error: handleError
}); });
} else { } else {
// x-www-form-urlencoded // x-www-form-urlencoded
$.ajax({ $.ajax({
url: "./jsp_example_send_at_r1.jsp", url: "./jsp_example_send_at_r1.jsp",
type: "POST", type: "POST",
data: payload, data: payload,
dataType: "json", dataType: "json",
success: handleSuccess, success: handleSuccess,
error: handleError error: handleError
}); });
} }
}); });
// ===== 수신자 추가 ===== // ===== 수신자 추가 =====
$("#addReceiver").off("click").on("click", function(){ $("#addReceiver").off("click").on("click", function(){
var nextId = $(".varItem").length + 1; var nextId = $(".varItem").length + 1;
var tpl = '' var tpl = ''
+ '<fieldset class="varItem" style="margin:8px 0;">' + '<fieldset class="varItem" style="margin:8px 0;">'
+ ' <legend>수신자 ' + nextId + '</legend>' + ' <legend>수신자 ' + nextId + '</legend>'
+ ' <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">' + ' <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">'
+ ' <colgroup><col style="width:180px"><col></colgroup>' + ' <colgroup><col style="width:180px"><col></colgroup>'
+ ' <tbody>' + ' <tbody>'
+ ' <tr><th align="left">수신자번호</th>' + ' <tr><th align="left">수신자번호</th>'
+ ' <td><input type="text" class="list_inputType1 callTo" size="30" value=""/></td></tr>' + ' <td><input type="text" class="list_inputType1 callTo" size="30" value=""/></td></tr>'
+ ' <tr><th align="left">알림톡 내용 </th>' + ' <tr><th align="left">알림톡 내용 </th>'
+ ' <td><textarea class="list_inputType1 msgTxt" rows="3" cols="80"></textarea></td></tr>' + ' <td><textarea class="list_inputType1 msgTxt" rows="3" cols="80"></textarea></td></tr>'
+ ' <tr><th align="left">알림톡 제목 (선택)</th>' + ' <tr><th align="left">알림톡 제목 (선택)</th>'
+ ' <td><input type="text" class="list_inputType1 title" size="60" value=""/></td></tr>' + ' <td><input type="text" class="list_inputType1 title" size="60" value=""/></td></tr>'
+ ' <tr><th align="left">대체문자 본문 (선택)</th>' + ' <tr><th align="left">대체문자 본문 (선택)</th>'
+ ' <td><input type="text" class="list_inputType1 altSms" size="80" value=""/></td></tr>' + ' <td><input type="text" class="list_inputType1 altSms" size="80" value=""/></td></tr>'
+ ' </tbody>' + ' </tbody>'
+ ' </table>' + ' </table>'
+ ' <div style="margin-top:6px;"><button type="button" class="mem_btn3 removeReceiver">삭제</button></div>' + ' <div style="margin-top:6px;"><button type="button" class="mem_btn3 removeReceiver">삭제</button></div>'
+ '</fieldset>'; + '</fieldset>';
$("#receiverList").append(tpl); $("#receiverList").append(tpl);
}); });
// ===== 수신자 삭제 (델리게이션) ===== // ===== 수신자 삭제 (델리게이션) =====
$(document).on("click", ".removeReceiver", function(){ $(document).on("click", ".removeReceiver", function(){
$(this).closest(".varItem").remove(); $(this).closest(".varItem").remove();
renumberReceivers(); renumberReceivers();
}); });
// ===== 페이로드 빌더 (Postman 스샷과 동일 키) ===== // ===== 페이로드 빌더 (Postman 스샷과 동일 키) =====
function buildPayload(){ function buildPayload(){
var p = { var p = {
// 공통(단건) 필드 // 공통(단건) 필드
mberId : $("#mberId").val(), // 필요없으면 서버에서 무시 mberId : $("#mberId").val(), // 필요없으면 서버에서 무시
accessKey : $("#apiKey").val(), // accessKey = apiKey 인풋 재사용 accessKey : $("#apiKey").val(), // accessKey = apiKey 인풋 재사용
senderKey : $("#senderKey").val(), senderKey : $("#senderKey").val(),
templateCode : $("#templateCode").val(), templateCode : $("#templateCode").val(),
subMsgSendYn : $("#subMsgSendYn").val(), // Y/N subMsgSendYn : $("#subMsgSendYn").val(), // Y/N
callFrom : $("#callFrom").val() callFrom : $("#callFrom").val()
// testYn 을 서버가 받는다면 여기에 testYn: $("#testYn").val() 추가 // testYn 을 서버가 받는다면 여기에 testYn: $("#testYn").val() 추가
}; };
// 수신자별(N명) 필드 // 수신자별(N명) 필드
var idx = 1; var idx = 1;
$(".varItem").each(function(){ $(".varItem").each(function(){
var callTo = $(this).find(".callTo").val(); var callTo = $(this).find(".callTo").val();
if (!callTo) return; // 번호 없으면 skip (인덱스 띄지 않도록 주의) if (!callTo) return; // 번호 없으면 skip (인덱스 띄지 않도록 주의)
var title = $(this).find(".title").val(); var title = $(this).find(".title").val();
var content = $(this).find(".msgTxt").val(); var content = $(this).find(".msgTxt").val();
var altSms = $(this).find(".altSms").val(); // 없으면 빈값 var altSms = $(this).find(".altSms").val(); // 없으면 빈값
// 스샷 규칙과 동일한 키로 세팅 // 스샷 규칙과 동일한 키로 세팅
p["callTo_" + idx] = callTo; p["callTo_" + idx] = callTo;
if (title) p["templateTitle_" + idx] = title; if (title) p["templateTitle_" + idx] = title;
if (content) p["templateContent_" + idx] = content; if (content) p["templateContent_" + idx] = content;
if (altSms) p["subMsgTxt_" + idx] = altSms; if (altSms) p["subMsgTxt_" + idx] = altSms;
// 치환변수 (var1, var2 …) // 치환변수 (var1, var2 …)
$(this).find(".variable").each(function(){ $(this).find(".variable").each(function(){
var varName = $(this).data("var"); // 예: var1 var varName = $(this).data("var"); // 예: var1
var varValue = $(this).val(); var varValue = $(this).val();
if (varName && varValue){ if (varName && varValue){
p[varName + "_" + idx] = varValue; // 예: var1_1 = '홍길동' p[varName + "_" + idx] = varValue; // 예: var1_1 = '홍길동'
} }
}); });
idx++; idx++;
}); });
return p; return p;
} }
// ===== 성공/에러 공통 처리 ===== // ===== 성공/에러 공통 처리 =====
function handleSuccess(ret){ function handleSuccess(ret){
console.log("returnData :: ", ret); console.log("returnData :: ", ret);
if (ret && ret.data && ret.data.resultCode == "0"){ if (ret && ret.data && ret.data.resultCode == "0"){
$("#msgGroupId").text(ret.data.msgGroupId || ""); $("#msgGroupId").text(ret.data.msgGroupId || "");
$("#resultCode").text(ret.data.resultCode || ""); $("#resultCode").text(ret.data.resultCode || "");
$("#resultMsg").text(ret.data.msg || ""); $("#resultMsg").text(ret.data.msg || "");
$("#successCnt").text(ret.data.successCnt || ""); $("#successCnt").text(ret.data.successCnt || "");
$("#failCnt").text(ret.data.failCnt || ""); $("#failCnt").text(ret.data.failCnt || "");
} else { } else {
var rc = ret && ret.data ? ret.data.resultCode : "UNKNOWN"; var rc = ret && ret.data ? ret.data.resultCode : "UNKNOWN";
var rm = ret && ret.data ? ret.data.msg : "오류"; var rm = ret && ret.data ? ret.data.msg : "오류";
$("#resultCode").text(rc); $("#resultCode").text(rc);
$("#resultMsg").text(rm); $("#resultMsg").text(rm);
alert(rc + " : " + rm); alert(rc + " : " + rm);
} }
} }
function handleError(req, status, err){ function handleError(req, status, err){
alert(req + "///" + err + "///" + status + "///AJAX_ERROR"); alert(req + "///" + err + "///" + status + "///AJAX_ERROR");
console.log("AJAX_ERROR", req, status, err); console.log("AJAX_ERROR", req, status, err);
} }
// ===== 가독성용: 수신자 번호 레전드 재정렬 ===== // ===== 가독성용: 수신자 번호 레전드 재정렬 =====
function renumberReceivers(){ function renumberReceivers(){
$(".varItem").each(function(i){ $(".varItem").each(function(i){
$(this).find("legend").text("수신자 " + (i+1)); $(this).find("legend").text("수신자 " + (i+1));
}); });
} }
}); });
</script> </script>
@ -159,125 +159,125 @@ $(function(){
<body> <body>
<div class="inner"> <div class="inner">
<div class="send_top"> <div class="send_top">
<div class="mypage_content current" id="tab5_3"> <div class="mypage_content current" id="tab5_3">
<div class="heading"> <div class="heading">
<h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2> <h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2>
<h2>알림톡 발송(샘플-문자온)</h2> <h2>알림톡 발송(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 <b>jsp_example_send_at_r1.jsp</b> 파일에 작성하여 사용하세요.<br/> *mberId와 accessKey값은 실제 서비스시에는 <b>jsp_example_send_at_r1.jsp</b> 파일에 작성하여 사용하세요.<br/>
(샘플 페이지에서는 원활한 테스트를 위해 파라미터 형식으로 제공합니다.) (샘플 페이지에서는 원활한 테스트를 위해 파라미터 형식으로 제공합니다.)
<br/><br/> <br/><br/>
</div> </div>
<!-- 기본 설정 --> <!-- 기본 설정 -->
<fieldset> <fieldset>
<legend>알림톡 기본 설정</legend> <legend>알림톡 기본 설정</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;"> <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:260px"><col></colgroup> <colgroup><col style="width:260px"><col></colgroup>
<tbody> <tbody>
<!-- 필요 시 주석 해제해서 사용 필요 시 주석 해제해서 사용
<tr> <tr>
<th align="left">*mberId</th> <th align="left">*mberId</th>
<td><input type="text" class="list_inputType1" id="mberId" size="40" value="your_biz_id" /></td> <td><input type="text" class="list_inputType1" id="mberId" size="40" value="dudgusw" /></td>
</tr> </tr>
<tr> <tr>
<th align="left">*api key</th> <th align="left">*api key</th>
<td><input type="text" class="list_inputType1" id="apiKey" size="60" value="your_api_key" /></td> <td><input type="text" class="list_inputType1" id="apiKey" size="60" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" /></td>
</tr> </tr>
-->
<tr>
<th align="left">*senderKey (카카오 알림톡 채널ID)</th>
<td><input type="text" class="list_inputType1" id="senderKey" size="60" value="your_sender_key" /></td>
</tr>
<tr>
<th align="left">*templateCode (카카오 알림톡 템플릿 코드)</th>
<td><input type="text" class="list_inputType1" id="templateCode" size="60" value="your_template_code" /></td>
</tr>
<tr>
<th align="left">callFrom (발신번호)</th>
<td><input type="text" class="list_inputType1" id="callFrom" size="30" value="01093414986" /></td>
</tr>
<tr>
<th align="left">subMsgSendYn (대체문자 전송 여부)</th>
<td>
<input type="text" class="list_inputType1" id="subMsgSendYn" size="5" value="Y" />
<span>(Y-전송, N-전송안함)</span>
</td>
</tr>
<tr>
<th align="left">테스트여부</th>
<td>
<input type="text" class="list_inputType1" id="testYn" size="6" />
<span>(기본값 없음, YF-테스트(실패), YS-테스트(성공))</span>
</td>
</tr>
</tbody>
</table>
</fieldset>
<!-- 수신자 목록 --> <tr>
<fieldset style="margin-top:16px;"> <th align="left">*senderKey (카카오 알림톡 채널ID)</th>
<legend>수신자 목록</legend> <td><input type="text" class="list_inputType1" id="senderKey" size="60" value="669143473b1af459628b8bdf2f48da090c8895de" /></td>
</tr>
<tr>
<th align="left">*templateCode (카카오 알림톡 템플릿 코드)</th>
<td><input type="text" class="list_inputType1" id="templateCode" size="60" value="bizp_2025031410525347794704159" /></td>
</tr>
<tr>
<th align="left">callFrom (발신번호)</th>
<td><input type="text" class="list_inputType1" id="callFrom" size="30" value="010-9341-4986" /></td>
</tr>
<tr>
<th align="left">subMsgSendYn (대체문자 전송 여부)</th>
<td>
<input type="text" class="list_inputType1" id="subMsgSendYn" size="5" value="Y" />
<span>(Y-전송, N-전송안함)</span>
</td>
</tr>
<tr>
<th align="left">테스트여부</th>
<td>
<input type="text" class="list_inputType1" id="testYn" size="6" />
<span>(기본값 없음, YF-테스트(실패), YS-테스트(성공))</span>
</td>
</tr>
</tbody>
</table>
</fieldset>
<div style="margin:8px 0;"> <!-- 수신자 목록 -->
<button type="button" class="mem_btn3" id="addReceiver">수신자 추가</button> <fieldset style="margin-top:16px;">
</div> <legend>수신자 목록</legend>
<div id="receiverList"> <div style="margin:8px 0;">
<!-- 기본 수신자 1 --> <button type="button" class="mem_btn3" id="addReceiver">수신자 추가</button>
<fieldset class="varItem" style="margin:8px 0;"> </div>
<legend>수신자 1</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:180px"><col></colgroup>
<tbody>
<tr>
<th align="left">수신자번호</th>
<td><input type="text" class="list_inputType1 callTo" size="30" value="01000001111" /></td>
</tr>
<tr>
<th align="left">알림톡 내용</th>
<td><textarea class="list_inputType1 msgTxt" rows="3" cols="80">안녕하세요. 알림톡 테스트입니다.</textarea></td>
</tr>
<tr>
<th align="left">알림톡 제목 (선택)</th>
<td><input type="text" class="list_inputType1 title" size="60" value="테스트 제목" /></td>
</tr>
<tr>
<th align="left">대체문자 본문 (선택)</th>
<td><input type="text" class="list_inputType1 altSms" size="80" value=""></td>
</tr>
</tbody> <div id="receiverList">
</table> <!-- 기본 수신자 1 -->
<div style="margin-top:6px;"> <fieldset class="varItem" style="margin:8px 0;">
<button type="button" class="mem_btn3 removeReceiver">삭제</button> <legend>수신자 1</legend>
</div> <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
</fieldset> <colgroup><col style="width:180px"><col></colgroup>
</div> <tbody>
<tr>
<th align="left">수신자번호</th>
<td><input type="text" class="list_inputType1 callTo" size="30" value="01000001111" /></td>
</tr>
<tr>
<th align="left">알림톡 내용</th>
<td><textarea class="list_inputType1 msgTxt" rows="3" cols="80">테스트 홍길동\n타이틀 버튼 치환 테스트입니다.</textarea></td>
</tr>
<tr>
<th align="left">알림톡 제목 (선택)</th>
<td><input type="text" class="list_inputType1 title" size="60" value="테스트 홍길동111" /></td>
</tr>
<tr>
<th align="left">대체문자 본문 (선택)</th>
<td><input type="text" class="list_inputType1 altSms" size="80" value="대체문자 발송"></td>
</tr>
<div style="margin-top:16px;"> </tbody>
<button type="button" class="mem_btn3" style="width:100%;" id="ajax_send_at" onclick="return false;">알림톡 발송</button> </table>
</div> <div style="margin-top:6px;">
</fieldset> <button type="button" class="mem_btn3 removeReceiver">삭제</button>
</div>
</fieldset>
</div>
<!-- 결과 --> <div style="margin-top:16px;">
<fieldset style="margin-top:16px;"> <button type="button" class="mem_btn3" style="width:100%;" id="ajax_send_at" onclick="return false;">알림톡 발송</button>
<legend>발송 결과</legend> </div>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;"> </fieldset>
<colgroup><col style="width:180px"><col></colgroup>
<tbody>
<tr><th align="left">메세지그룹ID</th><td><span id="msgGroupId"></span></td></tr>
<tr><th align="left">결과코드</th><td><span id="resultCode"></span></td></tr>
<tr><th align="left">결과메시지</th><td><span id="resultMsg"></span></td></tr>
<tr><th align="left">성공수량</th><td><span id="successCnt"></span></td></tr>
<tr><th align="left">실패수량</th><td><span id="failCnt"></span></td></tr>
</tbody>
</table>
</fieldset>
</div> <!-- 결과 -->
</div> <fieldset style="margin-top:16px;">
<legend>발송 결과</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:180px"><col></colgroup>
<tbody>
<tr><th align="left">메세지그룹ID</th><td><span id="msgGroupId"></span></td></tr>
<tr><th align="left">결과코드</th><td><span id="resultCode"></span></td></tr>
<tr><th align="left">결과메시지</th><td><span id="resultMsg"></span></td></tr>
<tr><th align="left">성공수량</th><td><span id="successCnt"></span></td></tr>
<tr><th align="left">실패수량</th><td><span id="failCnt"></span></td></tr>
</tbody>
</table>
</fieldset>
</div>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -15,12 +15,17 @@ response.setCharacterEncoding("UTF-8");
try { try {
// ===== 고정값(실서비스는 서버 보관) ===== // ===== 고정값(실서비스는 서버 보관) =====
final String MBER_ID = "dudgusw";
final String API_KEY = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91";
// ===== 전송 URL ===== // ===== 전송 URL =====
// final String apiUrl = "http://119.193.215.98:8087/api/kakao/at/sendMsg"; // final String apiUrl = "http://119.193.215.98:8087/api/kakao/at/sendMsg";
final String apiUrl = "http://localhost:8088/api/kakao/at/sendMsg"; final String apiUrl = "http://119.193.215.98:8087/api/kakao/at/sendMsg";
String p_mberId = request.getParameter("mberId"); //사용자 ID
String p_apiKey = request.getParameter("accessKey"); //API KEY
System.out.println("p_mberId : "+ p_mberId);
System.out.println("p_apiKey : "+ p_apiKey);
// ===== 공통 파라미터 수신 (p_* / 비접두어 둘 다 허용) ===== // ===== 공통 파라미터 수신 (p_* / 비접두어 둘 다 허용) =====
String senderKey = request.getParameter("p_senderKey"); if (senderKey == null) senderKey = request.getParameter("senderKey"); String senderKey = request.getParameter("p_senderKey"); if (senderKey == null) senderKey = request.getParameter("senderKey");
@ -29,12 +34,14 @@ try {
String subMsgSendYn = request.getParameter("p_subMsgSendYn"); if (subMsgSendYn == null) subMsgSendYn = request.getParameter("subMsgSendYn"); String subMsgSendYn = request.getParameter("p_subMsgSendYn"); if (subMsgSendYn == null) subMsgSendYn = request.getParameter("subMsgSendYn");
String testYn = request.getParameter("p_testYn"); if (testYn == null) testYn = request.getParameter("testYn"); String testYn = request.getParameter("p_testYn"); if (testYn == null) testYn = request.getParameter("testYn");
System.out.println("senderKey : "+ senderKey);
if (callFrom != null) callFrom = callFrom.replaceAll("\\D", ""); // 숫자만 if (callFrom != null) callFrom = callFrom.replaceAll("\\D", ""); // 숫자만
// ===== form 구성 (x-www-form-urlencoded) ===== // ===== form 구성 (x-www-form-urlencoded) =====
List<NameValuePair> form = new ArrayList<>(); List<NameValuePair> form = new ArrayList<>();
form.add(new BasicNameValuePair("mberId", MBER_ID)); form.add(new BasicNameValuePair("mberId", p_mberId));
form.add(new BasicNameValuePair("accessKey", API_KEY)); form.add(new BasicNameValuePair("accessKey", p_apiKey));
form.add(new BasicNameValuePair("senderKey", senderKey != null ? senderKey : "")); form.add(new BasicNameValuePair("senderKey", senderKey != null ? senderKey : ""));
form.add(new BasicNameValuePair("templateCode", templateCode != null ? templateCode : "")); form.add(new BasicNameValuePair("templateCode", templateCode != null ? templateCode : ""));
form.add(new BasicNameValuePair("callFrom", callFrom != null ? callFrom : "")); form.add(new BasicNameValuePair("callFrom", callFrom != null ? callFrom : ""));

View File

@ -6,51 +6,72 @@
<title>친구톡(FT) 발송 샘플</title> <title>친구톡(FT) 발송 샘플</title>
<script src="./jquery-3.5.0.js"></script> <script src="./jquery-3.5.0.js"></script>
</head> </head>
<body> <body>
<div class="inner">
<div class="send_top">
<div class="mypage_content current" id="tab5_3">
<div class="heading">
<h2><a href="./jsp_example_start_form_r1.jsp">돌아가기</a></h2>
<h2>친구톡 발송(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 <b>jsp_example_send_ft_r1.jsp</b> 파일에 작성하여 사용하세요.<br/>
(샘플 페이지에서는 원활한 테스트를 위해 파라미터 형식으로 제공합니다.)
<br/><br/>
</div>
<h2>친구톡(FT) 발송(샘플)</h2> <h2>친구톡(FT) 발송(샘플)</h2>
<form id="ftForm" method="post" action="./jsp_example_send_ft_r1.jsp" enctype="multipart/form-data"> <form id="ftForm" method="post" action="./jsp_example_send_ft_r1.jsp" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend>공통</legend> <legend>공통</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;"> <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:220px"><col></colgroup> <colgroup><col style="width:220px"><col></colgroup>
<tr><th align="left">*senderKey</th><td><input type="text" name="senderKey" size="60" value=""/></td></tr>
<tr><th align="left">adFlag</th><td><input type="text" name="adFlag" size="4" value="N"/> (Y/N)</td></tr>
<tr><th align="left">subMsgSendYn</th><td><input type="text" name="subMsgSendYn" size="4" value="Y"/> (Y/N)</td></tr>
<tr><th align="left">callFrom</th><td><input type="text" name="callFrom" size="20" value="010-9341-4986"/></td></tr>
<tr><th align="left">button(JSON)</th><td>
<textarea name="button" rows="4" cols="80">{ "button": [ { "name":"사이트", "linkType":"WL", "linkMo":"https://m.example.com", "linkPc":"https://www.example.com" } ] }</textarea>
<div style="color:#666;">※ WL/AL만 가능</div>
</td></tr>
<tr><th align="left">templateImage</th><td><input type="file" name="templateImage" accept="image/*"/></td></tr>
<!-- 서버 경로로 보낼 때는 아래 사용(선택) -->
<!-- <tr><th align="left">templateImagePath</th><td><input type="text" name="templateImagePath" size="80" value="/path/to/image.jpg"/></td></tr> -->
<tr><th align="left">testYn</th><td><input type="text" name="testYn" size="6" value=""/> (YS-성공, YF-실패, 공란-실발송)</td></tr>
</table>
</fieldset>
<fieldset style="margin-top:12px;"> <tr><th align="left">*mberId</th><td><input type="text" name="mberId" size="60" value="dudgusw"/></td></tr>
<legend>수신자 목록</legend>
<div id="receiverList">
<fieldset class="rItem" style="margin:8px 0;">
<legend>수신자 1</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:180px"><col></colgroup>
<tr><th align="left">callTo_1</th><td><input type="text" name="callTo_1" size="30" value="01083584250"/></td></tr>
<tr><th align="left">templateContent_1</th><td><textarea name="templateContent_1" rows="3" cols="80">친구톡 본문 1</textarea></td></tr>
<tr><th align="left">subMsgTxt_1</th><td><input type="text" name="subMsgTxt_1" size="80" value="대체문자 발송1"/></td></tr>
</table>
<div style="margin-top:6px;"><button type="button" class="removeBtn">삭제</button></div>
</fieldset>
</div>
<div style="margin:8px 0;">
<button type="button" id="addReceiver">수신자 추가</button>
</div>
</fieldset>
<div style="margin-top:12px;"> <tr><th align="left">*API_KEY</th><td><input type="text" name="API_KEY" size="60" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91"/></td></tr>
<button type="submit" id="sendBtn" style="width:100%;">친구톡 발송</button>
</div> <tr><th align="left">*senderKey</th><td><input type="text" name="senderKey" size="60" value="669143473b1af459628b8bdf2f48da090c8895de"/></td></tr>
<tr><th align="left">adFlag</th><td><input type="text" name="adFlag" size="4" value="N"/> (Y/N)</td></tr>
<tr><th align="left">subMsgSendYn</th><td><input type="text" name="subMsgSendYn" size="4" value="Y"/> (Y/N)</td></tr>
<tr><th align="left">callFrom</th><td><input type="text" name="callFrom" size="20" value="010-9341-4986"/></td></tr>
<tr><th align="left">button(JSON)</th><td>
<textarea name="button" rows="4" cols="80">{ "button": [ { "name":"사이트", "linkType":"WL", "linkMo":"https://m.example.com", "linkPc":"https://www.example.com" } ] }</textarea>
<div style="color:#666;">※ WL/AL만 가능</div>
</td></tr>
<tr><th align="left">templateImage</th><td><input type="file" name="templateImage" accept="image/*"/></td></tr>
<!-- 서버 경로로 보낼 때는 아래 사용(선택) -->
<!-- <tr><th align="left">templateImagePath</th><td><input type="text" name="templateImagePath" size="80" value="/path/to/image.jpg"/></td></tr> -->
<tr><th align="left">testYn</th><td><input type="text" name="testYn" size="6" value=""/> (YS-성공, YF-실패, 공란-실발송)</td></tr>
</table>
</fieldset>
<fieldset style="margin-top:12px;">
<legend>수신자 목록</legend>
<div id="receiverList">
<fieldset class="rItem" style="margin:8px 0;">
<legend>수신자 1</legend>
<table border="1" cellspacing="0" cellpadding="6" style="width:100%;">
<colgroup><col style="width:180px"><col></colgroup>
<tr><th align="left">callTo_1</th><td><input type="text" name="callTo_1" size="30" value="01083584250"/></td></tr>
<tr><th align="left">templateContent_1</th><td><textarea name="templateContent_1" rows="3" cols="80">친구톡 본문 1</textarea></td></tr>
<tr><th align="left">subMsgTxt_1</th><td><input type="text" name="subMsgTxt_1" size="80" value="대체문자 발송1"/></td></tr>
</table>
<div style="margin-top:6px;"><button type="button" class="removeBtn">삭제</button></div>
</fieldset>
</div>
<div style="margin:8px 0;">
<button type="button" id="addReceiver">수신자 추가</button>
</div>
</fieldset>
<div style="margin-top:12px;">
<button type="submit" id="sendBtn" style="width:100%;">친구톡 발송</button>
</div>
</form> </form>
<hr/> <hr/>
@ -59,49 +80,52 @@
<script> <script>
$(function(){ $(function(){
// 수신자 추가 // 수신자 추가
$("#addReceiver").on("click", function(){ $("#addReceiver").on("click", function(){
var n = $(".rItem").length + 1; var n = $(".rItem").length + 1;
var tpl = '' var tpl = ''
+ '<fieldset class="rItem" style="margin:8px 0;">' + '<fieldset class="rItem" style="margin:8px 0;">'
+ ' <legend>수신자 '+ n +'</legend>' + ' <legend>수신자 '+ n +'</legend>'
+ ' <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">' + ' <table border="1" cellspacing="0" cellpadding="6" style="width:100%;">'
+ ' <colgroup><col style="width:180px"><col></colgroup>' + ' <colgroup><col style="width:180px"><col></colgroup>'
+ ' <tr><th align="left">callTo_'+n+'</th><td><input type="text" name="callTo_'+n+'" size="30" value=""/></td></tr>' + ' <tr><th align="left">callTo_'+n+'</th><td><input type="text" name="callTo_'+n+'" size="30" value=""/></td></tr>'
+ ' <tr><th align="left">templateContent_'+n+'</th><td><textarea name="templateContent_'+n+'" rows="3" cols="80"></textarea></td></tr>' + ' <tr><th align="left">templateContent_'+n+'</th><td><textarea name="templateContent_'+n+'" rows="3" cols="80"></textarea></td></tr>'
+ ' <tr><th align="left">subMsgTxt_'+n+'</th><td><input type="text" name="subMsgTxt_'+n+'" size="80" value=""/></td></tr>' + ' <tr><th align="left">subMsgTxt_'+n+'</th><td><input type="text" name="subMsgTxt_'+n+'" size="80" value=""/></td></tr>'
+ ' </table>' + ' </table>'
+ ' <div style="margin-top:6px;"><button type="button" class="removeBtn">삭제</button></div>' + ' <div style="margin-top:6px;"><button type="button" class="removeBtn">삭제</button></div>'
+ '</fieldset>'; + '</fieldset>';
$("#receiverList").append(tpl); $("#receiverList").append(tpl);
}); });
// 수신자 삭제 // 수신자 삭제
$(document).on("click", ".removeBtn", function(){ $(document).on("click", ".removeBtn", function(){
$(this).closest(".rItem").remove(); $(this).closest(".rItem").remove();
$(".rItem").each(function(i){ $(this).find("legend").text("수신자 " + (i+1)); }); $(".rItem").each(function(i){ $(this).find("legend").text("수신자 " + (i+1)); });
}); });
// 폼 제출 AJAX (파일 포함) // 폼 제출 AJAX (파일 포함)
$("#ftForm").on("submit", function(e){ $("#ftForm").on("submit", function(e){
e.preventDefault(); e.preventDefault();
var fd = new FormData(this); var fd = new FormData(this);
$.ajax({ $.ajax({
url: $(this).attr("action"), url: $(this).attr("action"),
type: "POST", type: "POST",
data: fd, data: fd,
processData: false, processData: false,
contentType: false, contentType: false,
success: function(ret){ success: function(ret){
try { $("#resultBox").text(JSON.stringify(ret, null, 2)); } try { $("#resultBox").text(JSON.stringify(ret, null, 2)); }
catch(e) { $("#resultBox").text(ret); } catch(e) { $("#resultBox").text(ret); }
}, },
error: function(req, st, err){ error: function(req, st, err){
$("#resultBox").text("ERROR: " + st + " / " + err); $("#resultBox").text("ERROR: " + st + " / " + err);
} }
}); });
}); });
}); });
</script> </script>
</div>
</div>
</div>
</body> </body>
</html> </html>

View File

@ -79,18 +79,18 @@
</div> </div>
<div class="mem_cont_in"> <div class="mem_cont_in">
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<!-- 발신자 번호 --> <!-- 발신자 번호 -->
<div class="input_list_item"> <div class="input_list_item">

View File

@ -24,8 +24,8 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용 //회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용
//실제서비스용 //실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디 // final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api ke // final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api ke
//테스트용 //테스트용
@ -34,11 +34,14 @@
/******************** 전송 요청 URL ********************/ /******************** 전송 요청 URL ********************/
// final String apiUrl = "https://api.munjaon.co.kr/api/send/sendMsg"; //개발테스트용 URL // final String apiUrl = "https://api.munjaon.co.kr/api/send/sendMsg"; //개발테스트용 URL
String apiUrl = "/api/send/sendMsg"; //개발테스트용 URL URL // String apiUrl = "/api/send/sendMsg"; //개발테스트용 URL URL
// final String apiUrl = "http://119.193.215.98:8087/api/send/sendMsg"; //개발테스트용 URL final String apiUrl = "http://119.193.215.98:8087/api/send/sendMsg"; //개발테스트용 URL
// final String apiUrl = "http://192.168.0.96:8088/api/send/sendMsg"; //개발테스트용 URL
/******************** 전송 정보 ********************/ /******************** 전송 정보 ********************/
//필수 값 //필수 값
String p_mberId = request.getParameter("p_mberId"); //발신자 번호
String p_apiKey = request.getParameter("p_apiKey"); //수신자 번호
String p_callFrom = request.getParameter("p_callFrom"); //발신자 번호 String p_callFrom = request.getParameter("p_callFrom"); //발신자 번호
String p_callToList = request.getParameter("p_callToList"); //수신자 번호 String p_callToList = request.getParameter("p_callToList"); //수신자 번호
String p_smsTxt = request.getParameter("p_smsTxt"); //문자 내용 String p_smsTxt = request.getParameter("p_smsTxt"); //문자 내용
@ -47,7 +50,7 @@
String p_nameStr = request.getParameter("p_nameStr"); //치환용 이름 String p_nameStr = request.getParameter("p_nameStr"); //치환용 이름
String p_testYn = request.getParameter("p_testYn"); //테스트 데이터 여부 '', 'YF', 'YS' String p_testYn = request.getParameter("p_testYn"); //테스트 데이터 여부 '', 'YF', 'YS'
String p_api_ip = request.getParameter("p_api_ip"); //테스트 데이터 여부 '', 'YF', 'YS' String p_api_ip = request.getParameter("p_api_ip"); //테스트 데이터 여부 '', 'YF', 'YS'
apiUrl += p_api_ip; // apiUrl += p_api_ip;
/* 추후 사용을 위하여 주석 상태로 보존 - 사용자 샘플 JSP에는 해당 내용 삭제 */ /* 추후 사용을 위하여 주석 상태로 보존 - 사용자 샘플 JSP에는 해당 내용 삭제 */
@ -75,8 +78,8 @@
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
//필수 전송 데이터 //필수 전송 데이터
params.put("mberId", mberId); //회원 아이디 params.put("mberId", p_mberId); //회원 아이디
params.put("accessKey", apiKey); //인증키 params.put("accessKey", p_apiKey); //인증키
params.put("callFrom" , p_callFrom); //발신자 번호 params.put("callFrom" , p_callFrom); //발신자 번호
params.put("callToList" , p_callToList); //수신자 번호 params.put("callToList" , p_callToList); //수신자 번호
params.put("smsTxt" , p_smsTxt); //문자 내용 params.put("smsTxt" , p_smsTxt); //문자 내용

View File

@ -97,7 +97,7 @@
<br/> <br/>
<!-- 문자발송 설명 및 입력 영역 시작 --> <!-- 문자발송 설명 및 입력 영역 시작 -->
<h2>대량문자발송(샘플-문자온)</h2> <h2>대량문자발송(샘플-문자온)</h2>
*mberId와 accessKey값은 실제 서비스시에는 jsp_example_send_msg_r1.jsp 파일에 작성하여 사용하세요 *mberId와 accessKey값은 실제 서비스시에는 jsp_example_send_msgs_r1.jsp 파일에 작성하여 사용하세요
<br/>(샘플 페이지에서는 월활한 테스트를 위해 파라미터 형식으로 제공합니다.) <br/>(샘플 페이지에서는 월활한 테스트를 위해 파라미터 형식으로 제공합니다.)
<br/><br/><br/> <br/><br/><br/>
@ -114,18 +114,18 @@
</div> </div>
<div class="input_list"> <div class="input_list">
<!--
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*mberId <div class="input_left">*mberId
<input type="text" class="list_inputType1" id="mberId" maxlength="100" value="goodgkdus" size="100"/> <input type="text" class="list_inputType1" id="mberId" maxlength="100" value="dudgusw" size="100"/>
</div> </div>
</div> </div>
<div class="input_list_item"> <div class="input_list_item">
<div class="input_left">*api key <div class="input_left">*api key
<input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="24cb8ec4ed7c16969d2ab2988dd2406ee2820" size="100"/> <input type="text" class="list_inputType1" id="apiKey" maxlength="100" value="3429312e6a2c732188d4cc7d15d8a1baa01d8d91" size="100"/>
</div> </div>
</div> </div>
-->
<!-- 발신자 번호 --> <!-- 발신자 번호 -->
<div class="input_list_item"> <div class="input_list_item">

View File

@ -24,8 +24,8 @@
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용 //회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용
//실제서비스용 //실제서비스용
final String mberId = "dudgusw"; //문자온 로그인 아이디 // final String mberId = "dudgusw"; //문자온 로그인 아이디
final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api ke // final String apiKey = "3429312e6a2c732188d4cc7d15d8a1baa01d8d91"; //발급받은 api ke
//테스트용 //테스트용
@ -39,7 +39,9 @@
// final String apiUrl = "http://localhost:8088/api/send/sendMsgs"; //개발테스트용 URL // final String apiUrl = "http://localhost:8088/api/send/sendMsgs"; //개발테스트용 URL
/******************** 전송 정보 ********************/ /******************** 전송 정보 ********************/
//필수 값’ //필수 값
String p_mberId = request.getParameter("p_mberId"); //발신자 번호
String p_apiKey = request.getParameter("p_apiKey"); //수신자 번호’
String p_callFrom = request.getParameter("p_callFrom"); //발신자 번호 String p_callFrom = request.getParameter("p_callFrom"); //발신자 번호
String p_callTo_1 = request.getParameter("p_callTo_1"); //수신자 번호 1 String p_callTo_1 = request.getParameter("p_callTo_1"); //수신자 번호 1
String p_smsTxt_1 = request.getParameter("p_smsTxt_1"); //문자 내용 1 String p_smsTxt_1 = request.getParameter("p_smsTxt_1"); //문자 내용 1
@ -73,8 +75,8 @@
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
//필수 전송 데이터 //필수 전송 데이터
params.put("mberId", mberId); //회원 아이디 params.put("mberId", p_mberId); //회원 아이디
params.put("accessKey", apiKey); //인증키 params.put("accessKey", p_apiKey); //인증키
params.put("callFrom" , p_callFrom); //발신번호 params.put("callFrom" , p_callFrom); //발신번호
//선택 전송 데이터 //선택 전송 데이터