# 브랜드 메시지 템플릿

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

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

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

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

```python
def getBMSTemplateMgtURL(corpNum, userID)
```

### 요청

**Parameters**

- corpNum `type: str` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- userID `type: str` `length: 50` `required: Y` `description: 팝빌회원 아이디`

### 응답

str - 요청에 대한 응답 URL

### 예외

**PopbillException**

- code `type: int` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `type: str` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

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

```python
def getBMSTemplate(corpNum, templateCode, userID=None)
```

### 요청

**Parameters**

- corpNum `type: str` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- templateCode `type: str` `length: 12` `required: Y` `description: 템플릿 코드`
- userID `type: str` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**BMSTemplate**

- templateCode `type: str` `length: 12` `description: 템플릿 코드`
- templateType `type: str` `length: 4` `description: 템플릿 유형`
  - `BMST`: 브랜드 메시지 텍스트
  - `BMSI`: 브랜드 메시지 이미지
  - `BMSW`: 브랜드 메시지 와이드
  - `BMSL`: 브랜드 메시지 리스트
  - `BMSC`: 브랜드 메시지 캐러셀
  - `BMSM`: 브랜드 메시지 커머스
  - `BMSA`: 브랜드 메시지 캐러셀 커머스
- templateName `type: str` `length: 200` `description: 템플릿 제목`
- content `type: str` `length: 1,300` `description: 템플릿 내용`
- plusFriendID `type: str` `length: 30` `description: 검색용 아이디`
- adultYN `type: bool` `length: -` `description: 성인용 메시지 여부`
- header `type: str` `length: 20` `description: 제목`
- addContent `type: str` `length: 34` `description: 부가메시지`
- imageUrl `type: str` `length: -` `description: 이미지 URL`
- imageLink `type: str` `length: 500` `description: 이미지 링크 URL`
- state `type: int` `length: -` `description: 템플릿 상태`
  - `1`: 사용
  - `3`: 차단
- stateDT `type: str` `length: 14` `description: 템플릿 상태 일시`
  - 형식 : yyyyMMddHHmmss
- item `type: list[KakaoItem]` `length: 20` `description: 아이템 목록`
  - title `type: str` `length: 30` `description: 타이틀`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- commerce `type: KakaoCommerce` `length: -` `description: 커머스 정보`
  - title `type: str` `length: 30` `description: 상품명`
  - regularPrice `type: int` `length: -` `description: 정상가격`
    - 0 \~ 99,999,999
  - discountType `type: str` `length: 1` `description: 할인유형`
    - `R`: 할인율
    - `F`: 할인금액
  - discount `type: int` `length: -` `description: 할인율/할인금액`
    - {discountType}="R" 경우 1 \~ 100\
      {discountType}="F" 경우 0 \~ 999,999
  - discountPrice `type: int` `length: -` `description: 할인가격`
    - 0 \~ 99,999,999
    - 할인 적용 후 최종 가격
- head `type: KakaoCarouselHead` `length: -` `description: 캐러셀 인트로`
  - header `type: str` `length: 20` `description: 제목`
  - content `type: str` `length: 50` `description: 내용`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- carousel `type: list[KakaoCarousel]` `length: 6` `description: 캐러셀 목록`
  - header `type: str` `length: 20` `description: 제목`
  - content `type: str` `length: 180` `description: 내용`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - imageLink `type: str` `length: 500` `description: 이미지 링크 URL`
    - 이미지를 클릭하면 연결되는 URL
  - addContent `type: str` `length: 34` `description: 부가메시지`
  - commerce `type: KakaoCommerce` `length: -` `description: 커머스 정보`
    - title `type: str` `length: 30` `description: 상품명`
    - regularPrice `type: int` `length: -` `description: 정상가격`
      - 0 \~ 99,999,999
    - discountType `type: str` `length: 1` `description: 할인유형`
      - `R`: 할인율
      - `F`: 할인금액
    - discount `type: int` `length: -` `description: 할인율/할인금액`
      - {discountType}="R" 경우 1 \~ 100\
        {discountType}="F" 경우 0 \~ 999,999
    - discountPrice `type: int` `length: -` `description: 할인가격`
      - 0 \~ 99,999,999
      - 할인 적용 후 최종 가격
  - btns `type: KakaoButton[ ]` `length: 2` `description: 버튼 목록`
    - n `type: str` `length: 8` `description: 버튼명`
    - t `type: str` `length: 2` `description: 버튼유형`
      - `WL`: 웹링크
      - `AL`: 앱링크
      - `MD`: 메시지전달
      - `BK`: 봇키워드
      - `AC`: 채널추가
    - u1 `type: str` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 iOS 앱링크 적용
      - {t} = "WL" 경우 Mobile 웹링크 적용
    - u2 `type: str` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 Android 앱링크 적용
      - {t} = "WL" 경우 PC 웹링크 적용
  - coupon `type: KakaoCoupon` `length: -` `description: 쿠폰`
    - title `type: str` `length: 15` `description: 쿠폰 제목`
      - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
      - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
      - `배송비 할인 쿠폰`
      - `#{7자 이내} 무료 쿠폰`
      - `#{7자 이내} UP 쿠폰`
    - description `type: str` `length: 12` `description: 쿠폰 설명`
      - 줄바꿈 사용 불가
    - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
    - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
    - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
    - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- tail `type: KakaoCarouselTail` `length: -` `description: 캐러셀 더보기`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- btns `type: list[KakaoButton]` `length: 5` `description: 버튼 목록`
  - n `type: str` `length: 14` `description: 버튼명`
  - t `type: str` `length: 2` `description: 버튼유형`
    - `WL`: 웹링크
    - `AL`: 앱링크
    - `MD`: 메시지전달
    - `BK`: 봇키워드
    - `AC`: 채널추가
  - u1 `type: str` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 iOS 앱링크 적용
    - {t} = "WL" 경우 Mobile 웹링크 적용
  - u2 `type: str` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 Android 앱링크 적용
    - {t} = "WL" 경우 PC 웹링크 적용
- coupon `type: KakaoCoupon` `length: -` `description: 쿠폰`
  - title `type: str` `length: 15` `description: 쿠폰 제목`
    - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
    - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
    - `배송비 할인 쿠폰`
    - `#{7자 이내} 무료 쿠폰`
    - `#{7자 이내} UP 쿠폰`
  - description `type: str` `length: 12` `description: 쿠폰 설명`
    - 줄바꿈 사용 불가
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`

### 예외

**PopbillException**

- code `type: int` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `type: str` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

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

```python
def listBMSTemplate(corpNum, userID=None)
```

### 요청

**Parameters**

- corpNum `type: str` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- userID `type: str` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**list\[BMSTemplate]**

- templateCode `type: str` `length: 12` `description: 템플릿 코드`
- templateType `type: str` `length: 4` `description: 템플릿 유형`
  - `BMST`: 브랜드 메시지 텍스트
  - `BMSI`: 브랜드 메시지 이미지
  - `BMSW`: 브랜드 메시지 와이드
  - `BMSL`: 브랜드 메시지 리스트
  - `BMSC`: 브랜드 메시지 캐러셀
  - `BMSM`: 브랜드 메시지 커머스
  - `BMSA`: 브랜드 메시지 캐러셀 커머스
- templateName `type: str` `length: 200` `description: 템플릿 제목`
- content `type: str` `length: 1,300` `description: 템플릿 내용`
- plusFriendID `type: str` `length: 30` `description: 검색용 아이디`
- adultYN `type: bool` `length: -` `description: 성인용 메시지 여부`
- header `type: str` `length: 20` `description: 제목`
- addContent `type: str` `length: 34` `description: 부가메시지`
- imageUrl `type: str` `length: -` `description: 이미지 URL`
- imageLink `type: str` `length: 500` `description: 이미지 링크 URL`
- state `type: int` `length: -` `description: 템플릿 상태`
  - `1`: 사용
- stateDT `type: str` `length: 14` `description: 템플릿 상태 일시`
  - 형식 : yyyyMMddHHmmss
- item `type: list[KakaoItem]` `length: 20` `description: 아이템 목록`
  - title `type: str` `length: 30` `description: 타이틀`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- commerce `type: KakaoCommerce` `length: -` `description: 커머스 정보`
  - title `type: str` `length: 30` `description: 상품명`
  - regularPrice `type: int` `length: -` `description: 정상가격`
    - 0 \~ 99,999,999
  - discountType `type: str` `length: 1` `description: 할인유형`
    - `R`: 할인율
    - `F`: 할인금액
  - discount `type: int` `length: -` `description: 할인율/할인금액`
    - {discountType}="R" 경우 1 \~ 100\
      {discountType}="F" 경우 0 \~ 999,999
  - discountPrice `type: int` `length: -` `description: 할인가격`
    - 0 \~ 99,999,999
    - 할인 적용 후 최종 가격
- head `type: KakaoCarouselHead` `length: -` `description: 캐러셀 인트로`
  - header `type: str` `length: 20` `description: 제목`
  - content `type: str` `length: 50` `description: 내용`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- carousel `type: list[KakaoCarousel]` `length: 6` `description: 캐러셀 목록`
  - header `type: str` `length: 20` `description: 제목`
  - content `type: str` `length: 180` `description: 내용`
  - imageUrl `type: str` `length: 500` `description: 이미지 URL`
  - imageLink `type: str` `length: 500` `description: 이미지 링크 URL`
    - 이미지를 클릭하면 연결되는 URL
  - addContent `type: str` `length: 34` `description: 부가메시지`
  - commerce `type: KakaoCommerce` `length: -` `description: 커머스 정보`
    - title `type: str` `length: 30` `description: 상품명`
    - regularPrice `type: int` `length: -` `description: 정상가격`
      - 0 \~ 99,999,999
    - discountType `type: str` `length: 1` `description: 할인유형`
      - `R`: 할인율
      - `F`: 할인금액
    - discount `type: int` `length: -` `description: 할인율/할인금액`
      - {discountType}="R" 경우 1 \~ 100\
        {discountType}="F" 경우 0 \~ 999,999
    - discountPrice `type: int` `length: -` `description: 할인가격`
      - 0 \~ 99,999,999
      - 할인 적용 후 최종 가격
  - btns `type: KakaoButton[ ]` `length: 2` `description: 버튼 목록`
    - n `type: str` `length: 8` `description: 버튼명`
    - t `type: str` `length: 2` `description: 버튼유형`
      - `WL`: 웹링크
      - `AL`: 앱링크
      - `MD`: 메시지전달
      - `BK`: 봇키워드
      - `AC`: 채널추가
    - u1 `type: str` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 iOS 앱링크 적용
      - {t} = "WL" 경우 Mobile 웹링크 적용
    - u2 `type: str` `length: 1,000` `description: 버튼링크`
      - {t} = "AL" 경우 Android 앱링크 적용
      - {t} = "WL" 경우 PC 웹링크 적용
  - coupon `type: KakaoCoupon` `length: -` `description: 쿠폰`
    - title `type: str` `length: 15` `description: 쿠폰 제목`
      - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
      - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
      - `배송비 할인 쿠폰`
      - `#{7자 이내} 무료 쿠폰`
      - `#{7자 이내} UP 쿠폰`
    - description `type: str` `length: 12` `description: 쿠폰 설명`
      - 줄바꿈 사용 불가
    - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
    - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
    - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
    - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- tail `type: KakaoCarouselTail` `length: -` `description: 캐러셀 더보기`
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`
- btns `type: list[KakaoButton]` `length: 5` `description: 버튼 목록`
  - n `type: str` `length: 14` `description: 버튼명`
  - t `type: str` `length: 2` `description: 버튼유형`
    - `WL`: 웹링크
    - `AL`: 앱링크
    - `MD`: 메시지전달
    - `BK`: 봇키워드
    - `AC`: 채널추가
  - u1 `type: str` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 iOS 앱링크 적용
    - {t} = "WL" 경우 Mobile 웹링크 적용
  - u2 `type: str` `length: 1,000` `description: 버튼링크`
    - {t} = "AL" 경우 Android 앱링크 적용
    - {t} = "WL" 경우 PC 웹링크 적용
- coupon `type: KakaoCoupon` `length: -` `description: 쿠폰`
  - title `type: str` `length: 15` `description: 쿠폰 제목`
    - `#{숫자}원 할인 쿠폰`: (숫자 : 1\~99,999,999)
    - `#{숫자}% 할인 쿠폰`: (숫자 : 1\~100)
    - `배송비 할인 쿠폰`
    - `#{7자 이내} 무료 쿠폰`
    - `#{7자 이내} UP 쿠폰`
  - description `type: str` `length: 12` `description: 쿠폰 설명`
    - 줄바꿈 사용 불가
  - linkMobile `type: str` `length: 1,000` `description: Mobile 웹링크`
  - linkPc `type: str` `length: 1,000` `description: PC 웹링크`
  - linkAndroid `type: str` `length: 1,000` `description: Android 앱링크`
  - linkIos `type: str` `length: 1,000` `description: iOS 앱링크`

### 예외

**PopbillException**

- code `type: int` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `type: str` `length: -` `description: API 처리 실패에 대한 오류메시지`
