이미지 업로드
이미지형(IMAGE) 템플릿의 본문 이미지와, 아이템리스트형(ITEM_LIST)의 하이라이트 썸네일을 올립니다. 규격이 서로 달라 엔드포인트가 나뉘어 있습니다. 카카오 사본은 카카오에 올리기 직전에 서버가 만듭니다.
두 엔드포인트의 차이
| 구분 | 본문 이미지 | 하이라이트 썸네일 |
|---|---|---|
| 경로 | /alimtalk/templates/image | /alimtalk/templates/highlight_image |
| 쓰는 곳 | storage_image_url | item_highlight.storage_image_url |
| 형식 | jpg · png | jpg · png |
| 용량 | 500KB 이하 | 500KB 이하 |
| 가로 | 500px 이상 | 108px 이상 |
| 비율 | 2:1 | 1:1 |
1. 본문 이미지 업로드
요청 파라미터
multipart/form-data 로 보냅니다.
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| image | File | Y | jpg 또는 png 파일 |
| replace_url | String | N | 교체할 기존 이미지 URL. 업로드가 성공한 뒤에만 지웁니다 |
코드 예제
파일은 경로 문자열·IO·HTTP::FormData::File 을 모두 받습니다.
응답
curl -X POST "https://message.bootapi.com/alimtalk/templates/image" \
-H "Authorization: Basic {base64(client_key:secret_key)}" \
-F "image=@/path/to/banner.png"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.alimtalkTemplate.image('/path/to/banner.png')
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_template.image('/path/to/banner.png')
print(response)use Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->alimtalkTemplate->image('/path/to/banner.png');
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;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();
BootpayStoreResponse response = commerce.alimtalkTemplate.image("/path/to/banner.png");
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_template_image(image: '/path/to/banner.png')
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.AlimtalkTemplate.Image("/path/to/banner.png", "") // 두 번째 인자 replace_url(교체할 기존 이미지)은 비우면 보내지 않습니다
fmt.Println(response, err)using Bootpay.Commerce;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.AlimtalkTemplateImage("/path/to/banner.png");
Console.WriteLine(await response.Content.ReadAsStringAsync());JSON
{
"image_url": "https://storage.bootpay.co.kr/alimtalk/2026/08/27/banner.png"
}2. 하이라이트 썸네일 업로드
아이템리스트형의 하이라이트 영역에 들어가는 작은 정사각형 이미지입니다.
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| image | File | Y | jpg 또는 png 파일 (가로 108px 이상, 1:1) |
| replace_url | String | N | 교체할 기존 이미지 URL |
코드 예제
응답
이 값은 item_highlight.storage_image_url 로 넘깁니다.
curl -X POST "https://message.bootapi.com/alimtalk/templates/highlight_image" \
-H "Authorization: Basic {base64(client_key:secret_key)}" \
-F "image=@/path/to/thumb.png"const response = await commerce.alimtalkTemplate.highlightImage('/path/to/thumb.png')
console.log(response)response = commerce.alimtalk_template.highlight_image('/path/to/thumb.png')
print(response)$response = $commerce->alimtalkTemplate->highlightImage('/path/to/thumb.png');
print_r($response);BootpayStoreResponse response = commerce.alimtalkTemplate.highlightImage("/path/to/thumb.png");
System.out.println(response.getRawData());response = commerce.alimtalk_template_highlight_image(image: '/path/to/thumb.png')
puts response.dataresponse, err := commerce.AlimtalkTemplate.HighlightImage("/path/to/thumb.png", "") // 두 번째 인자 replace_url(교체할 기존 이미지)은 비우면 보내지 않습니다
fmt.Println(response, err)var response = await commerce.AlimtalkTemplateHighlightImage("/path/to/thumb.png");
Console.WriteLine(await response.Content.ReadAsStringAsync());JSON
{
"image_url": "https://storage.bootpay.co.kr/alimtalk/2026/08/27/thumb.png"
}이미지 지우기
템플릿 수정에서 storage_image_url 을 빈 값으로 보내면 이미지 삭제로 처리되고 카카오에도 반영됩니다.
에러 코드
오류 코드
| 코드 | error_code | 메시지 | 대처 방법 |
|---|---|---|---|
500 | STORAGE_NOT_IMAGE_FILE | 이미지 형식 오류 | jpg 또는 png 만 올릴 수 있습니다 |
501 | STORAGE_IMAGE_BLANK | 이미지 누락 | image 필드에 파일을 담았는지 확인합니다 |
505 | STORAGE_IMAGE_INVALID_SIZE | 규격 위반 | 용량 500KB·가로폭·비율 조건을 확인합니다 |
508 | STORAGE_IMAGE_UPLOAD_FAILED | storage 업로드 실패 | 잠시 후 다시 시도합니다 |