알림톡 template_id can't be null

문의 시, 사용하시는 개발환경과 디벨로퍼스 앱ID를 알려주세요.


<div>
    <label for="phoneNumber">전화번호:</label>
    <input type="text" id="phoneNumber" placeholder="010-1234-5678">
</div>
<div>
    <label for="templateId">템플릿 ID:</label>
    <input type="text" id="templateId" value="99527">
</div>
<div>
    <label for="messageContent">메시지 내용:</label>
    <input type="text" id="messageContent" placeholder="알림톡 메시지 내용을 입력하세요">
</div>
<button onclick="sendKakaoNotification()">알림톡 전송</button>


<script>
function sendKakaoNotification(phoneNumber, templateId, messageContent) {
  
    console.log(access)
    const apiUrl = "https://kapi.kakao.com/v2/api/talk/memo/send";
    const headers = {
        'Content-Type': 'application/json',
        'Authorization':'Bearer '+access // 발급받은 액세스 토큰을 입력하세요
    };
    
    
    const data = {
        phone: '01041519409', 
        template_id: '9952227',   // 승인받은 템플릿 ID
        template_args: {"data" : "data"}  // 메시지 내용 (JSON 형식)
    };
    
    console.log(data)

    fetch(apiUrl, {
        method: 'POST',
        headers: headers,
        body: JSON.stringify(data)
    })
    .then(response => response.json())
    .then(data => {
        console.log("알림톡 메시지 전송 결과:", data);
        
    })
    .catch(error => {
        console.error("알림톡 메시지 전송 오류:", error);
        console.log(data)
    });
}

function submitForm() {
    const phoneNumber = document.getElementById('phoneNumber').value;
    const templateId = document.getElementById('templateId').value;
    const messageContent = document.getElementById('messageContent').value;
    sendKakaoNotification(phoneNumber, templateId, messageContent);
}

// 사용 예시
//sendKakaoNotification('01012345678', '99527', {"key": "value"});

</script>

이게 코드인데 아무리봐도 template ID 가 있는데 자꾸template_id can’t be null.
이라고 리스폰스가 와서요 도움 부탁드립니다…

전화번호:
템플릿 ID:
메시지 내용:
알림톡 전송

안녕하세요.

사용하신 API 는 알림톡이 아니고 디벨로퍼스 메시지 API 입니다.

카카오톡 메시지: REST API | Kakao Developers 카카오톡 메시지: REST API
친구 api와 피커, 메시지 api 사용을 위한 체크 리스트

데브톡에서는 디벨로퍼스관련 설정과 SDK, API에 관한 기능적인 안내하고있습니다.
알림톡은 계약하신 딜러사나 카카오톡 채널 비즈메시지 고객센터에 문의 해보시겠어요?

KakaoTalk | kakao 고객센터