# 브랜드 메시지 템플릿

## 1. GetBMSTemplateMgtURL - 브랜드 메시지 템플릿 관리 팝업 URL

| HTTP Method | 테스트(Sandbox)                                   | 운영(Production)                            |
| ----------- | ---------------------------------------------- | ----------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/KakaoTalk> | <https://popbill.linkhub.co.kr/KakaoTalk> |

![브랜드 메시지 템플릿 관리 팝업 URL 미리보기](https://developers.popbill.com/images/reference/kakaotalk/getBMSTemplateMgtURL.png)

**브랜드 메시지 템플릿을 관리하는 팝업 URL을 반환합니다.**

- 권장 사이즈 : width = 1,000px (최소 1,000px) / height = 800px
- 반환되는 URL은 30초 동안만 사용이 가능합니다.
- 반환되는 URL에서만 유효한 세션을 포함하고 있습니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/kakaotalk/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Query 파라미터**

- TG `type: string` `length: -` `required: Y` `description: 고정값 : BMS_TEMPLATE`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/KakaoTalk?TG=BMS_TEMPLATE' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- url `type: string` `length: -` `description: 브랜드 메시지 템플릿 관리 팝업 URL`

**응답 예시**

```json
{
    "url": "https://test.popbill.com/App/API?T=IRXSGITDREOTPOIRLPUHCB4BSBC4...NX7BMAR3="
}
```

## 2. GetBMSTemplate - 브랜드 메시지 템플릿 정보 확인

| HTTP Method | 테스트(Sandbox)                                                              | 운영(Production)                                                       |
| ----------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/KakaoTalk/BMSTemplate/{templateCode}> | <https://popbill.linkhub.co.kr/KakaoTalk/BMSTemplate/{templateCode}> |

- 브랜드 메시지 템플릿 정보를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/kakaotalk/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Path 파라미터**

- templateCode `type: string` `length: 12` `required: Y` `description: 템플릿 코드`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/KakaoTalk/BMSTemplate/{templateCode}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- templateCode `type: string` `length: 12` `description: 템플릿 코드`
- templateType `type: string` `length: 4` `description: 템플릿 유형`
  - `BMST`: 브랜드 메시지 텍스트
  - `BMSI`: 브랜드 메시지 이미지
  - `BMSW`: 브랜드 메시지 와이드
  - `BMSL`: 브랜드 메시지 리스트
  - `BMSC`: 브랜드 메시지 캐러셀
  - `BMSM`: 브랜드 메시지 커머스
  - `BMSA`: 브랜드 메시지 캐러셀 커머스
- templateName `type: string` `length: 200` `description: 템플릿 제목`
- content `type: string` `length: 1,300` `description: 템플릿 내용`
- plusFriendID `type: string` `length: 30` `description: 검색용 아이디`
- adultYN `type: boolean` `length: -` `description: 성인용 메시지 여부`
- header `type: string` `length: 20` `description: 제목`
- addContent `type: string` `length: 34` `description: 부가메시지`
- imageUrl `type: string` `length: 500` `description: 이미지 URL`
- imageLink `type: string` `length: 500` `description: 이미지 링크 URL`
- state `type: number` `length: -` `description: 템플릿 상태`
  - `1`: 사용
  - `3`: 차단
- stateDT `type: string` `length: 14` `description: 템플릿 상태 일시`
  - 형식 : yyyyMMddHHmmss
- item `type: array` `length: -` `description: 아이템 리스트 목록`
  - title `type: string` `length: 30` `description: 타이틀`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
    - 메인 아이템인 경우 [\[UploadWideListMainImage - 리스트 메인 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadWideListMainImage) API로 응답받은 URL
    - 서브 아이템인 경우 [\[UploadWideListImage - 리스트 서브 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadWideListImage) API로 응답받은 URL
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- commerce `type: object` `length: -` `description: 커머스 정보`
  - title `type: string` `length: 30` `description: 상품명`
  - regularPrice `type: number` `length: -` `description: 정상가격`
    - 0 \~ 99,999,999
  - discountType `type: string` `length: 1` `description: 할인유형`
    - `R`: 할인율
    - `F`: 할인금액
  - discount `type: number` `length: -` `description: 할인율/할인금액`
    - {discountType}="R" 경우 1 \~ 100\
      {discountType}="F" 경우 0 \~ 999,999
  - discountPrice `type: number` `length: -` `description: 할인가격`
    - 0 \~ 99,999,999
    - 할인 적용 후 최종 가격
    - {discountType} 입력 시 필수
- head `type: object` `length: -` `description: 캐러셀 인트로`
  - header `type: string` `length: 20` `description: 제목`
  - content `type: string` `length: 50` `description: 내용`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
    - [\[UploadCarouselCommerceImage - 캐러셀 커머스 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadCarouselCommerceImage) API로 응답받은 URL
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- carousel `type: array` `length: -` `description: 캐러셀 목록`
  - header `type: string` `length: 20` `description: 제목`
  - content `type: string` `length: 180` `description: 내용`
  - addContent `type: string` `length: 34` `description: 부가메시지`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
  - imageLink `type: string` `length: 500` `description: 이미지 링크 URL`
  - commerce `type: object` `length: -` `description: 커머스 정보`
    - title `type: string` `length: 30` `description: 상품명`
    - regularPrice `type: number` `length: -` `description: 정상가격`
      - 0 \~ 99,999,999
    - discountType `type: string` `length: 1` `description: 할인유형`
      - `R`: 할인율
      - `F`: 할인금액
    - discount `type: number` `length: -` `description: 할인율/할인금액`
      - {discountType}="R" 경우 1 \~ 100\
        {discountType}="F" 경우 0 \~ 999,999
    - discountPrice `type: number` `length: -` `description: 할인가격`
      - 0 \~ 99,999,999
      - 할인 적용 후 최종 가격
      - {discountType} 입력 시 필수
  - btns `type: array` `length: -` `description: 버튼 목록`
    - n `type: string` `length: 8` `description: 버튼명`
    - t `type: string` `length: 2` `description: 버튼유형`
      - `WL`: 웹링크
      - `AL`: 앱링크
      - `MD`: 메시지전달
      - `BK`: 봇키워드
      - `AC`: 채널추가
    - u1 `type: string` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 iOS 앱링크 적용
      - {t} = "WL" 경우 Mobile 웹링크 적용
    - u2 `type: string` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 Android 앱링크 적용
      - {t} = "WL" 경우 PC 웹링크 적용
  - coupon `type: object` `length: -` `description: 쿠폰`
    - title `type: string` `length: 15` `description: 쿠폰 제목`
      - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
      - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
      - `배송비 할인 쿠폰`
      - `#{7자 이내} 무료 쿠폰`
      - `#{7자 이내} UP 쿠폰`
    - description `type: string` `length: 12` `description: 쿠폰 설명`
      - 줄바꿈 사용 불가
    - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
    - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
    - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
    - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- tail `type: object` `length: -` `description: 캐러셀 더보기`
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- btns `type: array` `length: -` `description: 버튼 목록`
  - n `type: string` `length: 14` `description: 버튼명`
  - t `type: string` `length: 2` `description: 버튼유형`
    - `WL`: 웹링크
    - `AL`: 앱링크
    - `MD`: 메시지전달
    - `BK`: 봇키워드
    - `AC`: 채널추가
  - u1 `type: string` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 iOS 앱링크 적용
    - {t} = "WL" 경우 Mobile 웹링크 적용
  - u2 `type: string` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 Android 앱링크 적용
    - {t} = "WL" 경우 PC 웹링크 적용
- coupon `type: object` `length: -` `description: 쿠폰`
  - title `type: string` `length: 15` `description: 쿠폰 제목`
    - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
    - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
    - `배송비 할인 쿠폰`
    - `#{7자 이내} 무료 쿠폰`
    - `#{7자 이내} UP 쿠폰`
  - description `type: string` `length: 12` `description: 쿠폰 설명`
    - 줄바꿈 사용 불가
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`

**응답 예시**

```json
{
    "templateCode": "026050000001",
    "plusFriendID": "@팝빌",
    "templateType": "BMST",
    "templateName": "테스트",
    "adultYN": false,
    "content": "테스트",
    "state": 1,
    "stateDT": "20260504113705"
}
```

## 3. ListBMSTemplate - 브랜드 메시지 템플릿 목록 확인

| HTTP Method | 테스트(Sandbox)                                                | 운영(Production)                                         |
| ----------- | ----------------------------------------------------------- | ------------------------------------------------------ |
| GET         | <https://popbill-test.linkhub.co.kr/KakaoTalk/BMSTemplates> | <https://popbill.linkhub.co.kr/KakaoTalk/BMSTemplates> |

- “사용” 상태의 브랜드 메시지 템플릿 목록을 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/kakaotalk/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/KakaoTalk/BMSTemplates' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- templateCode `type: string` `length: 12` `description: 템플릿 코드`
- templateType `type: string` `length: 4` `description: 템플릿 유형`
  - `BMST`: 브랜드 메시지 텍스트
  - `BMSI`: 브랜드 메시지 이미지
  - `BMSW`: 브랜드 메시지 와이드
  - `BMSL`: 브랜드 메시지 리스트
  - `BMSC`: 브랜드 메시지 캐러셀
  - `BMSM`: 브랜드 메시지 커머스
  - `BMSA`: 브랜드 메시지 캐러셀 커머스
- templateName `type: string` `length: 200` `description: 템플릿 제목`
- content `type: string` `length: 1,300` `description: 템플릿 내용`
- plusFriendID `type: string` `length: 30` `description: 검색용 아이디`
- adultYN `type: boolean` `length: -` `description: 성인용 메시지 여부`
- header `type: string` `length: 20` `description: 제목`
- addContent `type: string` `length: 34` `description: 부가메시지`
- imageUrl `type: string` `length: 500` `description: 이미지 URL`
- imageLink `type: string` `length: 500` `description: 이미지 링크 URL`
- state `type: number` `length: -` `description: 템플릿 상태`
  - `1`: 사용
- stateDT `type: string` `length: 14` `description: 템플릿 상태 일시`
  - 형식 : yyyyMMddHHmmss
- item `type: array` `length: -` `description: 아이템 리스트 목록`
  - title `type: string` `length: 30` `description: 타이틀`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
    - 메인 아이템인 경우 [\[UploadWideListMainImage - 리스트 메인 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadWideListMainImage) API로 응답받은 URL
    - 서브 아이템인 경우 [\[UploadWideListImage - 리스트 서브 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadWideListImage) API로 응답받은 URL
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- commerce `type: object` `length: -` `description: 커머스 정보`
  - title `type: string` `length: 30` `description: 상품명`
  - regularPrice `type: number` `length: -` `description: 정상가격`
    - 0 \~ 99,999,999
  - discountType `type: string` `length: 1` `description: 할인유형`
    - `R`: 할인율
    - `F`: 할인금액
  - discount `type: number` `length: -` `description: 할인율/할인금액`
    - {discountType}="R" 경우 1 \~ 100\
      {discountType}="F" 경우 0 \~ 999,999
  - discountPrice `type: number` `length: -` `description: 할인가격`
    - 0 \~ 99,999,999
    - 할인 적용 후 최종 가격
    - {discountType} 입력 시 필수
- head `type: object` `length: -` `description: 캐러셀 인트로`
  - header `type: string` `length: 20` `description: 제목`
  - content `type: string` `length: 50` `description: 내용`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
    - [\[UploadCarouselCommerceImage - 캐러셀 커머스 이미지 업로드\]](https://developers.popbill.com/api-reference/kakaotalk/api/send-bms#UploadCarouselCommerceImage) API로 응답받은 URL
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- carousel `type: array` `length: -` `description: 캐러셀 목록`
  - header `type: string` `length: 20` `description: 제목`
  - content `type: string` `length: 180` `description: 내용`
  - addContent `type: string` `length: 34` `description: 부가메시지`
  - imageUrl `type: string` `length: 500` `description: 이미지 URL`
  - imageLink `type: string` `length: 500` `description: 이미지 링크 URL`
  - commerce `type: object` `length: -` `description: 커머스 정보`
    - title `type: string` `length: 30` `description: 상품명`
    - regularPrice `type: number` `length: -` `description: 정상가격`
      - 0 \~ 99,999,999
    - discountType `type: string` `length: 1` `description: 할인유형`
      - `R`: 할인율
      - `F`: 할인금액
    - discount `type: number` `length: -` `description: 할인율/할인금액`
      - {discountType}="R" 경우 1 \~ 100\
        {discountType}="F" 경우 0 \~ 999,999
    - discountPrice `type: number` `length: -` `description: 할인가격`
      - 0 \~ 99,999,999
      - 할인 적용 후 최종 가격
      - {discountType} 입력 시 필수
  - btns `type: array` `length: -` `description: 버튼 목록`
    - n `type: string` `length: 8` `description: 버튼명`
    - t `type: string` `length: 2` `description: 버튼유형`
      - `WL`: 웹링크
      - `AL`: 앱링크
      - `MD`: 메시지전달
      - `BK`: 봇키워드
      - `AC`: 채널추가
    - u1 `type: string` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 iOS 앱링크 적용
      - {t} = "WL" 경우 Mobile 웹링크 적용
    - u2 `type: string` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 Android 앱링크 적용
      - {t} = "WL" 경우 PC 웹링크 적용
  - coupon `type: object` `length: -` `description: 쿠폰`
    - title `type: string` `length: 15` `description: 쿠폰 제목`
      - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
      - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
      - `배송비 할인 쿠폰`
      - `#{7자 이내} 무료 쿠폰`
      - `#{7자 이내} UP 쿠폰`
    - description `type: string` `length: 12` `description: 쿠폰 설명`
      - 줄바꿈 사용 불가
    - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
    - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
    - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
    - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- tail `type: object` `length: -` `description: 캐러셀 더보기`
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`
- btns `type: array` `length: -` `description: 버튼 목록`
  - n `type: string` `length: 14` `description: 버튼명`
  - t `type: string` `length: 2` `description: 버튼유형`
    - `WL`: 웹링크
    - `AL`: 앱링크
    - `MD`: 메시지전달
    - `BK`: 봇키워드
    - `AC`: 채널추가
  - u1 `type: string` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 iOS 앱링크 적용
    - {t} = "WL" 경우 Mobile 웹링크 적용
  - u2 `type: string` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 Android 앱링크 적용
    - {t} = "WL" 경우 PC 웹링크 적용
- coupon `type: object` `length: -` `description: 쿠폰`
  - title `type: string` `length: 15` `description: 쿠폰 제목`
    - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
    - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
    - `배송비 할인 쿠폰`
    - `#{7자 이내} 무료 쿠폰`
    - `#{7자 이내} UP 쿠폰`
  - description `type: string` `length: 12` `description: 쿠폰 설명`
    - 줄바꿈 사용 불가
  - linkMobile `type: string` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: string` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: string` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: string` `length: 1,000` `description: iOS 앱링크`

**응답 예시**

```json
[
    {
        "templateCode": "026050000001",
        "plusFriendID": "@팝빌",
        "templateType": "BMST",
        "templateName": "테스트",
        "adultYN": false,
        "content": "테스트",
        "state": 1,
        "stateDT": "20260504113705"
    }
]
```
