feat: api 샘플-문자온 페이지 요청 URL local -> apidev 로 수정

This commit is contained in:
hylee 2023-06-13 17:56:48 +09:00
parent efbea2aad0
commit 9c797395ce
6 changed files with 242 additions and 107 deletions

View File

@ -4,7 +4,7 @@
<p class="tType1_title">문자보내기(대량)</p>
<span class="reqTxt4">
동일한 내용의 문자를 컴마(,)로 분기하여 동시 1천명에게 전송하실 수 있습니다.
다른 내용의 문자를 동시에 100명에게 전송하실 수 있습니다.
</br>
발신번호는 사이트내에서 미리 등록된 번호만 사용하실 수 있습니다.
</br>
@ -14,6 +14,9 @@
</br>
<p class="tType1_title">
<img src="/publish/images/content/icon_fee1.png" alt="문자이미지"> [Request]
</p>
<ul class="clause_list">
<li class="list_open on">
<div class="clause_list_head">
@ -53,9 +56,6 @@
HTTPS 프로토콜을 사용하여 POST로 요청합니다.
</span>
<p class="tType1_title">
<img src="/publish/images/content/icon_fee1.png" alt="문자이미지"> 문자
</p>
<table class="tType2">
<caption></caption>
<colgroup>
@ -91,30 +91,39 @@
<td>String</td>
<td>O</td>
</tr>
<tr>
<th>callToList</th>
<td>수신자 번호 (콤마(,) 기준으로 입력)</td>
<td>String</td>
<td>O</td>
</tr>
<tr>
<th>smsTxt</th>
<td>메세지 내용</td>
<td>String (1~2,000Byte)</td>
<td>O</td>
</tr>
<tr>
<th>nameStr</th>
<td>메세지 내용에 [*이름*]이 있으면 치환용 이름 입력</td>
<td>String</td>
<td>X</td>
</tr>
<tr>
<th>test_yn</th>
<td>테스트 데이터 여부</td>
<td>String</td>
<td>X</td>
</tr>
<tr>
<th>callTo_1</th>
<td>수신자 번호 1</td>
<td>String</td>
<td>O</td>
</tr>
<tr>
<th>smsTxt_1</th>
<td>메세지 내용 1</td>
<td>String (1~2,000Byte)</td>
<td>O</td>
</tr>
<tr>
<td colspan="4">ㆍㆍㆍㆍ </td>
</tr>
<tr>
<th>callTo_100</th>
<td>수신자 번호 100</td>
<td>String</td>
<td>O</td>
</tr>
<tr>
<th>smsTxt_100</th>
<td>메세지 내용 100</td>
<td>String (1~2,000Byte)</td>
<td>O</td>
</tr>
</tbody>
</table>
<span class="reqTxt4">* 텍스트 용량(Byte)에 대한 안내 : 2Byte, 영문·숫자 1Byte를 차지.</span>
@ -124,7 +133,7 @@
<li class="list_open on">
<div class="clause_list_head">
<div class="list_head_in">
<span>Request</span>
<span>Example</span>
</div>
</div>
<div class="clause_list_body">
@ -135,15 +144,15 @@
<tbody>
<tr>
<td class="padding_add">
{<br />
<p>"mberId":"String"</p>
<p>,"accessKey":"String"</p>
<p>,"callFrom":"String"</p>
<p>,"callToList":"String"</p>
<p>,"smsTxt":"String"</p>
<p>,"nameStr":"String"</p>
<p>,"callFrom":"String"</p>
<p>,"test_yn":"( YS | YF )"</p>
{
<p>"mberId":"홍길동"</p>
<p>,"accessKey":"XXXXXXXXXXXXXX414050694b953"</p>
<p>,"callFrom":"01012341234"</p>
<p>,"test_yn":""</p>
<p>,"callTo_1":"01011111111"</p>
<p>,"smsTxt_1":"문자 테스트 1"</p>
<p>,"callTo_2":"01022222222"</p>
<p>,"smsTxt_2":"문자 테스트 2"</p>
}
</td>
</tr>
@ -152,3 +161,127 @@
</div>
</li>
</ul>
<p class="tType1_title">
<img src="/publish/images/content/icon_fee1.png" alt="문자이미지"> [Response]
</p>
<span class="reqTxt4">
JSON 객체로 응답 합니다.
</span>
<table class="tType2">
<caption></caption>
<colgroup>
<col style="width: 13%;">
<col style="width: auto;">
<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th>키</th>
<th>설명</th>
<th>타입</th>
</tr>
</thead>
<tbody>
<tr>
<th>resultCode</th>
<td>성공 여부 ( "0" 아니면 실패 )</td>
<td>String</td>
</tr>
<tr>
<th>data</th>
<td>결과값 객체 ( 성공 : 데이터, 실패 : 메세지 )</td>
<td>Object</td>
</tr>
<tr>
<th>[data].msgGroupId</th>
<td>메세지 그룹 ID</td>
<td>String</td>
</tr>
<tr>
<th>[data].msgType</th>
<td>메세지 타입 ( 4: 단문, 5: 장문 )</td>
<td>String</td>
</tr>
<tr>
<th>[data].blockCnt</th>
<td>수신거부 건수</td>
<td>String</td>
</tr>
<tr>
<th>[data].failCnt</th>
<td>전송실패 건수</td>
<td>String</td>
</tr>
<tr>
<th>[data].successCnt</th>
<td>성공 건수</td>
<td>String</td>
</tr>
</tbody>
</table>
<span class="reqTxt4">* 성공 예시</span>
<ul class="clause_list">
<li class="list_open on">
<div class="clause_list_head">
<div class="list_head_in">
<span>Example</span>
</div>
</div>
<div class="clause_list_body">
<table class="">
<colgroup>
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<td class="padding_add">
{
<p>"resultCode":"0"</p>
<p>, "data":[</p>
<div>
<p>"msgGroupId":"MSGGID_0000000000000"</p>
<p>, "msgType":"4"</p>
<p>, "blockCnt":"0"</p>
<p>, "failCnt":"0"</p>
<p>, "successCnt":"3"</p>
</div>
<p>]</p>
}
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
<span class="reqTxt4">* 실패 예시</span>
<ul class="clause_list">
<li class="list_open on">
<div class="clause_list_head">
<div class="list_head_in">
<span>Example</span>
</div>
</div>
<div class="clause_list_body">
<table class="">
<colgroup>
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<td class="padding_add">
{
<p>"resultCode":"1040"</p>
<p>,"data":"치환 데이터 오류"</p>
}
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>

View File

@ -34,8 +34,9 @@
/******************** 전송요청 URL ********************/
//final String apiUrl = "https://api.munjaon.co.kr/api/inqry/hstryDetail";
final String apiUrl = "http://localhost:8088/api/inqry/hstryDetail";
// final String apiUrl = "http://localhost:8088/api/inqry/hstryDetail";
String apiUrl = "https://apidev.munjaon.co.kr:9998/api/inqry/hstryDetail";
/**************** 발송가능건수 예제 ******************/
System.out.println("상세발송이력");

View File

@ -34,8 +34,9 @@
/******************** 전송요청 URL ********************/
//final String apiUrl = "https://api.munjaon.co.kr/api/inqry/hstry";
final String apiUrl = "http://localhost:8088/api/inqry/hstry";
// final String apiUrl = "http://localhost:8088/api/inqry/hstry";
String apiUrl = "https://apidev.munjaon.co.kr:9998/api/inqry/hstry"; // 전송요청 URL
/**************** 발송가능건수 예제 ******************/
System.out.println("전체발송이력");

View File

@ -33,8 +33,8 @@
/******************** 전송요청 URL ********************/
//final String apiUrl = "https://api.munjaon.co.kr/api/inqry/selectPrice";
final String apiUrl = "http://localhost:8088/api/inqry/selectPrice";
final String apiUrl = "https://apidev.munjaon.co.kr:9998/api/inqry/selectPrice";
// final String apiUrl = "http://localhost:8088/api/inqry/selectPrice";
/**************** 발송가능건수 예제 ******************/
System.out.println("잔액|단가|발송가능건수");

View File

@ -41,8 +41,9 @@
//String sms_url = "https://apis.aligo.in/send/"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessTest/Test"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessKey/SendMsg"; // 전송요청 URL
String apiUrl = "http://localhost:8088/api/send/sendMsg"; // 전송요청 URL
// final String apiUrl = "http://localhost:8088/api/api/send/sendMsg";
final String apiUrl = "https://apidev.munjaon.co.kr:9998/api/send/sendMsg";
Map<String, String> params = new HashMap<String, String>();
/******************** 인증정보 ********************/

View File

@ -18,82 +18,81 @@
<%@ page language="java" contentType="text/html; charset=utf-8 " pageEncoding="utf-8"%>
<%
try{
//기본 설정값
//기본 설정값
//final String encodingType = "utf-8";
final String encodingType = "UTF-8";
final String boundary = "____boundary____";
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
//final String mberId = "goodgkdus"; //문자온 로그인 아이디
//final String apiKey = "12e749877379aa7426275414050694b953"; //발급받은 api key
//회원아이디, APIKEY - 보안을 위해 실제 서비스 시에는 이곳에 mberId와 apiKey 값을 적어서 사용해주세요
//실제서비스용
//final String mberId = "goodgkdus"; //문자온 로그인 아이디
//final String apiKey = "12e749877379aa7426275414050694b953"; //발급받은 api key
//테스트용
String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
//테스트용
String mberId = request.getParameter("p_mberId"); //문자온 로그인 아이디
String apiKey = request.getParameter("p_apiKey"); //발급받은 api key
/**************** 문자전송하기 예제 ******************/
/* "result_code":결과코드,"message":결과문구, */
/* "msg_id":메세지ID,"error_cnt":에러갯수,"success_cnt":성공갯수 */
/* 동일내용 > 전송용 입니다.
/******************** 인증정보 ********************/
//String sms_url = "https://apis.aligo.in/send/"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessTest/Test"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessKey/SendMsg"; // 전송요청 URL
String apiUrl = "http://localhost:8088/api/send/sendMsgs"; // 전송요청 URL
/**************** 문자전송하기 예제 ******************/
/* "result_code":결과코드,"message":결과문구, */
/* "msg_id":메세지ID,"error_cnt":에러갯수,"success_cnt":성공갯수 */
/* 동일내용 > 전송용 입니다.
/******************** 인증정보 ********************/
//String sms_url = "https://apis.aligo.in/send/"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessTest/Test"; // 전송요청 URL
//String sms_url = "https://api.munjaon.co.kr:9998/api/accessKey/SendMsg"; // 전송요청 URL
// String apiUrl = "http://localhost:8088/api/send/sendMsgs"; // 전송요청 URL
String apiUrl = "https://apidev.munjaon.co.kr:9998/api/send/sendMsgs"; // 전송요청 URL
Map<String, String> params = new HashMap<String, String>();
params.put("mberId", mberId); // SMS 아이디
params.put("accessKey", apiKey); //인증키
/******************** 인증정보 ********************/
params.put("mberId", mberId); // SMS 아이디
params.put("accessKey", apiKey); //인증키
/******************** 인증정보 ********************/
//임시 - 테스트용 시작
//String p_mberId = request.getParameter("p_mberId"); //발신번호
//String p_accessKey = request.getParameter("p_accessKey"); //수신번호
//sms.put("mberId", p_mberId); // SMS 아이디
//sms.put("accessKey", p_accessKey); //인증키
//임시 - 테스트용 끝
/******************** 전송정보 ********************/
//전달 받은 값
//필수값
String p_callFrom = request.getParameter("p_callFrom"); //발신번호
String p_callTo_1 = request.getParameter("p_callTo_1"); //수신번호
//String p_eachPrice = request.getParameter("p_eachPrice"); //전송문자 개별가격
//String p_fileCnt = request.getParameter("p_fileCnt"); //첨부파일갯수
//String p_sPrice = request.getParameter("p_sPrice"); //단문문자단가
//String p_totPrice = request.getParameter("p_totPrice"); //총결제금액
//String p_txtReplYn = request.getParameter("p_txtReplYn"); //치환문자 여부 Y//N
//String p_txtReplYn = "N"; //치환문자 여부 - 초기 지원안함
//String p_msgType = request.getParameter("p_msgType"); //문자타입 4-단문,5-URL,6-MMS,7-BARCODE,8-카카오알림톡
//String p_msgKind = request.getParameter("p_msgKind"); //N-일반,A-광고,C-선거
//String p_msgKind = "N"; //N-일반,A-광고,C-선거 - 초기 지원안함
String p_smsTxt_1 = request.getParameter("p_smsTxt_1"); //SMS용 메시지본문
String p_testYn = request.getParameter("p_testYn"); //테스트데이터여부 '', 'YF', 'YS'
//String p_nameStr_1 = request.getParameter("p_nameStr_1"); //치환문자
//임시 - 테스트용 시작
//String p_mberId = request.getParameter("p_mberId"); //발신번호
//String p_accessKey = request.getParameter("p_accessKey"); //수신번호
//sms.put("mberId", p_mberId); // SMS 아이디
//sms.put("accessKey", p_accessKey); //인증키
//임시 - 테스트용 끝
/******************** 전송정보 ********************/
//전달 받은 값
//필수값
String p_callFrom = request.getParameter("p_callFrom"); //발신번호
String p_callTo_1 = request.getParameter("p_callTo_1"); //수신번호
//String p_eachPrice = request.getParameter("p_eachPrice"); //전송문자 개별가격
//String p_fileCnt = request.getParameter("p_fileCnt"); //첨부파일갯수
//String p_sPrice = request.getParameter("p_sPrice"); //단문문자단가
//String p_totPrice = request.getParameter("p_totPrice"); //총결제금액
//String p_txtReplYn = request.getParameter("p_txtReplYn"); //치환문자 여부 Y//N
//String p_txtReplYn = "N"; //치환문자 여부 - 초기 지원안함
//String p_msgType = request.getParameter("p_msgType"); //문자타입 4-단문,5-URL,6-MMS,7-BARCODE,8-카카오알림톡
//String p_msgKind = request.getParameter("p_msgKind"); //N-일반,A-광고,C-선거
//String p_msgKind = "N"; //N-일반,A-광고,C-선거 - 초기 지원안함
String p_smsTxt_1 = request.getParameter("p_smsTxt_1"); //SMS용 메시지본문
//String p_nameStr_1 = request.getParameter("p_nameStr_1"); //치환문자
//선택값
//String p_mmsPrice = request.getParameter("p_mmsPrice"); //mms단가
//String p_mPrice = request.getParameter("p_mPrice"); //장문문자단가
//String p_spamStatus = request.getParameter("p_spamStatus"); //스팸문자 유무
//선택값
//String p_mmsPrice = request.getParameter("p_mmsPrice"); //mms단가
//String p_mPrice = request.getParameter("p_mPrice"); //장문문자단가
//String p_spamStatus = request.getParameter("p_spamStatus"); //스팸문자 유무
//예약문자의 경우(선택값)
//String p_reserveYn = request.getParameter("p_reserveYn"); //예약문자 여부 N or Y
//String p_divideCnt = request.getParameter("p_divideCnt"); //분할문자 건수
//String p_divideTime = request.getParameter("p_divideTime"); //분할문자 간격
//String p_reqDate = request.getParameter("p_reqDate"); //예약시간
//예약문자의 경우(선택값)
//String p_reserveYn = request.getParameter("p_reserveYn"); //예약문자 여부 N or Y
//String p_divideCnt = request.getParameter("p_divideCnt"); //분할문자 건수
//String p_divideTime = request.getParameter("p_divideTime"); //분할문자 간격
//String p_reqDate = request.getParameter("p_reqDate"); //예약시간
//추가 전송 데이터
params.put("callFrom" , p_callFrom); //발신번호
params.put("test_yn" , p_testYn); //테스트 여부
//추가 전송 데이터
params.put("callFrom" , p_callFrom); //발신번호
//params.put("callTo_1" , p_callTo_1); //수신번호
//params.put("eachPrice" , p_eachPrice); //전송문자 개별가격
//params.put("sPrice" , p_sPrice); //단문문자단가
//params.put("smsTxt_1" , p_smsTxt_1); //SMS용 메시지본문
//params.put("callTo_1" , p_callTo_1); //수신번호
//params.put("eachPrice" , p_eachPrice); //전송문자 개별가격
//params.put("sPrice" , p_sPrice); //단문문자단가
//params.put("smsTxt_1" , p_smsTxt_1); //SMS용 메시지본문
for (int i=1;i<101;i++){
@ -103,8 +102,8 @@
String s_callTo = "callTo_"+Integer.toString(i);
String s_smsTxt = "smsTxt_"+Integer.toString(i);
p_callTo_1 = request.getParameter(p_callTo); //SMS용 메시지본문
p_smsTxt_1 = request.getParameter(p_smsTxt); //SMS용 메시지본문
p_callTo_1 = request.getParameter(p_callTo); //SMS용 메시지본문
p_smsTxt_1 = request.getParameter(p_smsTxt); //SMS용 메시지본문
System.out.println("======i=====");
@ -117,10 +116,10 @@
&& !"".equals(p_callTo_1)
&& !"".equals(p_smsTxt_1)
){
params.put(s_callTo, p_callTo_1); //수신번호
//params.put("eachPrice" , p_eachPrice); //전송문자 개별가격
//params.put("sPrice" , p_sPrice); //단문문자단가
params.put(s_smsTxt, p_smsTxt_1); //SMS용 메시지본문
params.put(s_callTo, p_callTo_1); //수신번호
//params.put("eachPrice" , p_eachPrice); //전송문자 개별가격
//params.put("sPrice" , p_sPrice); //단문문자단가
params.put(s_smsTxt, p_smsTxt_1); //SMS용 메시지본문
}
}
@ -135,7 +134,7 @@
try{
for(Iterator<String> i = params.keySet().iterator(); i.hasNext();){
String key = i.next();
//전달값이 없는 경우 오류
//전달값이 없는 경우 오류
try{
builder.addTextBody(key, params.get(key)
, ContentType.create("Multipart/related", encodingType));