공동 템플릿 검색·상세
부트페이가 승인받아 둔 공식 알림톡 템플릿(주문·결제·배송·클레임·구독·회원 문구)을 검색하고 상세를 조회합니다. 채널을 연동했다면 검수 없이 바로 보낼 수 있습니다. 조회는 부트페이 데이터만 읽으므로 부작용이 없습니다.
카탈로그 밖의 문구는 자체 템플릿으로 만듭니다.
검색은 목록에서도 본문(content)과 필수 변수(required_variables)를 함께 돌려줍니다. ksp_id를 함께 넘기면 그 채널의 변수 예문 사전으로 미리보기 값까지 채워 줍니다.
공동 템플릿의 메시지 유형은 기본형(BA)과 부가정보형(EX) 둘뿐입니다. 채널추가형(AD)·복합형(MI)은 여러 채널이 함께 쓰는 그룹 템플릿에 담을 수 없으므로, 그 유형이 필요하면 자체 템플릿으로 만듭니다.
1. 공동 템플릿 검색
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| q | String | N | 검색어. 본문·이름·분류를 부분일치(대소문자 무시)로 찾습니다. keyword 로도 받습니다 |
| category | String | N | 분류 정확일치 |
| msg_type | String | N | BA(기본형) 또는 EX(부가정보형) |
| page | Integer | N | 페이지 번호 (기본 1) |
| per | Integer | N | 페이지 크기 (기본 20, 최대 100) |
| ksp_id | String | N | 이 채널의 예문 사전으로 variable_examples를 채웁니다 |
코드 예제
응답
categories는 필터와 무관하게 카탈로그 전체 기준으로 내려옵니다.
curl -X GET "https://message.bootapi.com/alimtalk/official?q=재입고&per=20" \
-H "Authorization: Basic {base64(client_key:secret_key)}"import { BootpayCommerce } from '@bootpay/backend-js'
const commerce = new BootpayCommerce({
client_key: 'your-commerce-client-key',
secret_key: 'your-commerce-secret-key',
mode: 'production'
})
const response = await commerce.alimtalkOfficial.list({
keyword: '재입고',
per: 20,
ksp_id: '6a718d6cdd5558fb1fff72af'
})
console.log(response)from bootpay_backend import BootpayCommerce
commerce = BootpayCommerce(
client_key='your-commerce-client-key',
secret_key='your-commerce-secret-key',
mode='production'
)
response = commerce.alimtalk_official.list({
'keyword': '재입고',
'per': 20,
'ksp_id': '6a718d6cdd5558fb1fff72af'
})
print(response)use Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->alimtalkOfficial->getList([
'keyword' => '재입고',
'per' => 20,
'ksp_id' => '6a718d6cdd5558fb1fff72af'
]);
print_r($response);import kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;
import kr.co.bootpay.store.model.response.BootpayStoreResponse;
import kr.co.bootpay.store.model.request.alimtalk.AlimtalkOfficialListParams;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();
AlimtalkOfficialListParams params = new AlimtalkOfficialListParams();
params.keyword = "재입고";
params.per = 20;
params.kspId = "6a718d6cdd5558fb1fff72af";
BootpayStoreResponse response = commerce.alimtalkOfficial.list(params);
System.out.println(response.getRawData());require 'bootpay'
commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.alimtalk_official_list(
keyword: '재입고',
per: 20,
ksp_id: '6a718d6cdd5558fb1fff72af'
)
puts response.dataimport "github.com/bootpay/backend-go/v2"
commerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
response, err := commerce.AlimtalkOfficial.List(&bootpay.AlimtalkOfficialListParams{
Keyword: "재입고",
Per: 20,
KspId: "6a718d6cdd5558fb1fff72af",
})
fmt.Println(response, err)using Bootpay.Commerce;
using Bootpay.Commerce.Models;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.AlimtalkOfficialList(new AlimtalkOfficialListParams {
Keyword = "재입고",
Per = 20,
KspId = "6a718d6cdd5558fb1fff72af"
});
Console.WriteLine(await response.Content.ReadAsStringAsync());JSON
{
"list": [
{
"code": "G_RESTOCK_NOTICE_user",
"name": "재입고 알림",
"category": "상품",
"msg_type": "BA",
"tags": ["재입고", "상품"],
"emphasize_type": "NONE",
"version": 1,
"instant_send": true,
"content": "#{company_name}\n#{user_name}님, 찜하신 상품이 재입고되었어요.",
"required_variables": ["company_name", "user_name", "mobile_link", "pc_link"],
"variable_examples": {
"company_name": "부트페이몰",
"user_name": "홍길동"
}
}
],
"count": 57,
"page": 1,
"per": 20,
"categories": ["배송", "주문", "회원"]
}2. 공동 템플릿 상세
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| code | String | Y | 템플릿 코드 (경로 파라미터, 슬래시를 포함하지 않습니다) |
| ksp_id | String | N | 이 채널의 예문 사전으로 variable_examples를 채웁니다 |
코드 예제
응답 필드
| 필드 | 타입 | 설명 |
|---|---|---|
| code | String | 발송할 때 쓰는 템플릿 코드 |
| name · category · tags | String · String · Array | 템플릿 이름 · 분류 · 태그 |
| msg_type | String | BA(기본형) 또는 EX(부가정보형) |
| version | Integer | 템플릿 버전 |
| content | String | 본문. 변수는 #{변수명} 형식 |
| required_variables | Array | 발송 시 반드시 채워야 하는 변수 |
| variable_examples | Object | 표시용 예문 (발송값이 아님) |
| emphasize_type | String | NONE·TEXT·IMAGE·ITEM_LIST |
| emphasize_title | String | 강조 타이틀. 발송할 때 치환됩니다 |
| emphasize_subtitle | String | 강조 보조문구. 변수를 써도 치환되지 않습니다 |
| buttons | Array | 버튼 목록 |
| template_extra | String | 부가정보형(EX)의 추가 문구 |
| template_header · item_highlight · template_item | String · Object · Object | 아이템리스트형 요소 |
| image_url · storage_image_url | String | 카카오에 등록된 이미지 주소 · 부트페이에 올린 원본 주소 |
| security_flag | Boolean | 보안 템플릿 여부 |
| instant_send | Boolean | 검수 없이 발송 가능 여부 |
curl -X GET "https://message.bootapi.com/alimtalk/official/G_RESTOCK_NOTICE_user" \
-H "Authorization: Basic {base64(client_key:secret_key)}"const response = await commerce.alimtalkOfficial.detail('G_RESTOCK_NOTICE_user')
console.log(response)response = commerce.alimtalk_official.detail('G_RESTOCK_NOTICE_user')
print(response)$response = $commerce->alimtalkOfficial->detail('G_RESTOCK_NOTICE_user');
print_r($response);BootpayStoreResponse response = commerce.alimtalkOfficial.detail("G_RESTOCK_NOTICE_user");
System.out.println(response.getRawData());response = commerce.alimtalk_official_detail(code: 'G_RESTOCK_NOTICE_user')
puts response.dataresponse, err := commerce.AlimtalkOfficial.Detail("G_RESTOCK_NOTICE_user", "") // 두 번째 인자 ksp_id 는 비우면 보내지 않습니다
fmt.Println(response, err)var response = await commerce.AlimtalkOfficialDetail("G_RESTOCK_NOTICE_user");
Console.WriteLine(await response.Content.ReadAsStringAsync());3. 문구로 공동 템플릿 추천받기
보내려는 문구를 넣으면 비슷한 공동 템플릿을 유사도가 높은 순으로 돌려줍니다.
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| text | String | Y | 보내려는 문구. 단어를 뽑을 수 없으면 빈 목록이 옵니다 |
| category | String | N | 분류 정확일치 |
| limit | Integer | N | 돌려줄 개수 (기본 5, 최대 20) |
| ksp_id | String | N | 이 채널의 예문 사전으로 variable_examples를 채웁니다 |
코드 예제
응답
list 의 각 항목은 위 상세 응답과 같은 필드에 유사도 score(0~1)가 더해진 모양입니다.
curl -X POST "https://message.bootapi.com/alimtalk/official/recommend" \
-H "Authorization: Basic {base64(client_key:secret_key)}" \
-H "Content-Type: application/json" \
-d '{ "text": "주문하신 상품이 재입고되었습니다", "limit": 3 }'const response = await commerce.alimtalkOfficial.recommend({
text: '주문하신 상품이 재입고되었습니다',
limit: 3
})
console.log(response)response = commerce.alimtalk_official.recommend({
'text': '주문하신 상품이 재입고되었습니다',
'limit': 3
})
print(response)$response = $commerce->alimtalkOfficial->recommend([
'text' => '주문하신 상품이 재입고되었습니다',
'limit' => 3
]);
print_r($response);import kr.co.bootpay.store.model.request.alimtalk.AlimtalkOfficialRecommendParams;
AlimtalkOfficialRecommendParams params = new AlimtalkOfficialRecommendParams();
params.text = "주문하신 상품이 재입고되었습니다";
params.limit = 3;
BootpayStoreResponse response = commerce.alimtalkOfficial.recommend(params);
System.out.println(response.getRawData());response = commerce.alimtalk_official_recommend(
text: '주문하신 상품이 재입고되었습니다',
limit: 3
)
puts response.dataresponse, err := commerce.AlimtalkOfficial.Recommend(bootpay.AlimtalkOfficialRecommendParams{
Text: "주문하신 상품이 재입고되었습니다",
Limit: 3,
})
fmt.Println(response, err)var response = await commerce.AlimtalkOfficialRecommend(new AlimtalkOfficialRecommendParams {
Text = "주문하신 상품이 재입고되었습니다",
Limit = 3
});
Console.WriteLine(await response.Content.ReadAsStringAsync());JSON
{
"list": [
{
"code": "G_RESTOCK_NOTICE_user",
"name": "재입고 알림",
"category": "상품",
"msg_type": "BA",
"content": "#{company_name}\n#{user_name}님, 찜하신 상품이 재입고되었어요.",
"required_variables": ["company_name", "user_name", "mobile_link", "pc_link"],
"instant_send": true,
"score": 0.7143
}
],
"count": 1
}에러 코드
오류 코드
| 코드 | error_code | 메시지 | 대처 방법 |
|---|---|---|---|
3015 | TEMPLATE_NOT_FOUND | 템플릿 없음 | 코드가 맞는지, 카탈로그에 노출되는 템플릿인지 확인합니다 |