# 비즈니스 채널 관리

## 1. GetPlusFriendMgtURL - 비즈니스 채널 등록 팝업 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/getPlustFriendMgtURL.png)

**비즈니스 채널을 등록하는 팝업 URL을 반환합니다.**

- 권장 사이즈 : width = 1,200px (최소 1,000px) / height = 750px
- 반환되는 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: 고정값 : PLUSFRIEND`

**요청 예시**

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

### Response

**응답 본문**

- url `type: string` `length: -` `description: 비즈니스 채널 등록 팝업 URL`

**응답 예시**

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

## 2. ListPlusFriendID - 비즈니스 채널 목록 확인

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

- 팝빌에 등록한 연동회원의 비즈니스 채널 목록을 확인합니다.

### 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/ListPlusFriendID' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- plusFriendID `type: string` `length: 30` `description: 검색용 아이디`
- plusFriendName `type: string` `length: 100` `description: 채널명`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- state `type: string` `length: 1` `description: 채널 상태`
  - `0`: 사용
  - `1`: 휴면
  - `2`: 차단
- stateDT `type: string` `length: 14` `description: 채널 상태 일시`
  - 형식 : yyyyMMddHHmmss
- bmsState `type: number` `length: -` `description: 브랜드 메시지 상태`
  - `1`: 심사중
  - `2`: 승인
  - `3`: 취소
  - 승인 상태의 경우 브랜드 메시지 전송대상 M, N 사용 가능
- bmsStateDT `type: string` `length: 14` `description: 브랜드 메시지 상태 일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
[
    {
        "plusFriendID": "@팝빌",
        "regDT": "20260126153750",
        "plusFriendName": "전자세금계산서 팝빌",
        "state": "0",
        "stateDT": "20260203153319",
        "bmsState": 1,
        "bmsStateDT": "20260126161953"
    }
]
```
