# 전송결과

## 1. GetMessages - 전송내역 확인 (접수번호)

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

- 팝빌에서 반환받은 접수번호를 통해 문자 전송상태 및 결과를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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 파라미터**

- receiptNum `type: string` `length: 18` `required: Y` `description: 팝빌에서 할당한 접수번호`

**요청 예시**

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

### Response

**응답 본문**

- subject `type: string` `length: 64` `description: 메시지 제목 (단위 : byte)`
  - 대체문자 내용이 90byte 초과한 경우에만 적용
  - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
- content `type: string` `length: -` `description: 메시지 내용 (단위 : byte)`
  - 단문 : 90byte 이하 / 장문 : 2,000byte 이하
  - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
- sendNum `type: string` `length: 20` `description: 발신번호`
- senderName `type: string` `length: 70` `description: 발신자명`
- receiveNum `type: string` `length: 20` `description: 수신번호`
- receiveName `type: string` `length: 70` `description: 수신자명`
- receiptDT `type: string` `length: 14` `description: 접수일시`
  - 형식 : yyyyMMddHHmmss
- sendDT `type: string` `length: 14` `description: 전송일시`
  - 형식 : yyyyMMddHHmmss
- resultDT `type: string` `length: 14` `description: 전송결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- reserveDT `type: string` `length: 14` `description: 예약일시`
  - 형식 : yyyyMMddHHmmss
- state `type: number` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/sms/response-code#state-code)
- result `type: number` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/sms/response-code#telecom-result-code)
- type `type: string` `length: 3` `description: 메시지 타입`
  - `SMS`: 단문
  - `LMS`: 장문
  - `MMS`: 포토문자
- tranNet `type: string` `length: 3` `description: 전송처리 이동통신사명`
- receiptNum `type: string` `length: 18` `description: 접수번호`
- requestNum `type: string` `length: 36` `description: 요청번호`
- interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
  - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

**응답 예시**

```json
[
    {
        "content": "메시지 내용",
        "sendNum": "16008536",
        "receiveNum": "01012345678",
        "receiptDT": "20251027105030",
        "sendDT": "20251027105033",
        "resultDT": "20251027105035",
        "result": 100,
        "tranNet": "LGT",
        "receiptNum": "025102710000000005",
        "state": 3,
        "type": "SMS"
    }
]
```

## 2. GetMessagesRN - 전송내역 확인 (요청번호)

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

- 파트너가 할당한 요청번호를 통해 문자 전송상태 및 결과를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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 파라미터**

- requestNum `type: string` `length: 36` `required: Y` `description: 파트너가 할당한 요청번호`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Message/Get/{requestNum}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- subject `type: string` `length: 64` `description: 메시지 제목 (단위 : byte)`
  - 대체문자 내용이 90byte 초과한 경우에만 적용
  - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
- content `type: string` `length: -` `description: 메시지 내용 (단위 : byte)`
  - 단문 : 90byte 이하 / 장문 : 2,000byte 이하
  - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
- sendNum `type: string` `length: 20` `description: 발신번호`
- senderName `type: string` `length: 70` `description: 발신자명`
- receiveNum `type: string` `length: 20` `description: 수신번호`
- receiveName `type: string` `length: 70` `description: 수신자명`
- receiptDT `type: string` `length: 14` `description: 접수일시`
  - 형식 : yyyyMMddHHmmss
- sendDT `type: string` `length: 14` `description: 전송일시`
  - 형식 : yyyyMMddHHmmss
- resultDT `type: string` `length: 14` `description: 전송결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- reserveDT `type: string` `length: 14` `description: 예약일시`
  - 형식 : yyyyMMddHHmmss
- state `type: number` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/sms/response-code#state-code)
- result `type: number` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/sms/response-code#telecom-result-code)
- type `type: string` `length: 3` `description: 메시지 타입`
  - `SMS`: 단문
  - `LMS`: 장문
  - `MMS`: 포토문자
- tranNet `type: string` `length: 3` `description: 전송처리 이동통신사명`
- receiptNum `type: string` `length: 18` `description: 접수번호`
- requestNum `type: string` `length: 36` `description: 요청번호`
- interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
  - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

**응답 예시**

```json
[
    {
        "content": "메시지 내용",
        "sendNum": "16008536",
        "receiveNum": "01012345678",
        "receiptDT": "20251027105545",
        "sendDT": "20251027105548",
        "resultDT": "20251027105551",
        "result": 100,
        "tranNet": "LGT",
        "receiptNum": "025102710000000006",
        "requestNum": "test001234",
        "state": 3,
        "type": "SMS"
    }
]
```

## 3. Search - 전송내역 목록 조회

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

- 검색조건에 해당하는 문자 전송내역을 조회합니다. (조회기간 단위 : 최대 2개월)
- 문자 접수일시로부터 12개월 이내 접수건만 조회할 수 있습니다.

> 매개변수 Page, PerPage, Order를 이용하여 페이징 기능을 구현할 수 있습니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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 파라미터**

- SDate `type: string` `length: 8` `required: Y` `description: 검색 시작일자`
  - 형식 : yyyyMMdd
- EDate `type: string` `length: 8` `required: Y` `description: 검색 종료일자`
  - 형식 : yyyyMMdd
- State `type: string` `length: -` `required: Y` `description: 전송상태 (다중 선택 가능)`
  - `1`: 대기
  - `2`: 성공
  - `3`: 실패
  - `4`: 취소
  - 다중 선택시 콤마(',')로 구분. 예) 1,2
- Item `type: string` `length: -` `required: N` `description: 검색대상 (다중 선택 가능)`
  - `SMS`: 단문
  - `LMS`: 장문
  - `MMS`: 포토문자
  - 다중 선택시 콤마(',')로 구분. 예) SMS,LMS
  - 기본값 : 전체조회
- ReserveYN `type: boolean` `length: -` `required: N` `description: 예약여부`
  - `true`: 예약전송건
  - `false`: 즉시전송건
  - 기본값 : 전체조회
- SenderOnly `type: boolean` `length: -` `required: N` `description: 사용자권한별 조회`
  - `true`: 팝빌회원 아이디(UserID)로 전송한 문자만 조회
  - `false`: 전송한 문자 전체 조회 : 기본값
- Page `type: number` `length: -` `required: N` `description: 목록 페이지번호`
  - 기본값 : 1
- PerPage `type: number` `length: -` `required: N` `description: 페이지당 표시할 목록 건수`
  - 최대 : 1,000건
  - 기본값 : 500건
- Order `type: string` `length: 1` `required: N` `description: 문자 접수일시를 기준으로 하는 목록 정렬 방향`
  - `D`: 내림차순 : 기본값
  - `A`: 오름차순
- QString `type: string` `length: -` `required: N` `description: 조회 검색어(발신자명, 수신자명, 수신번호)`
  - 기본값 : 전체조회

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Message/Search?SDate={SDate}&EDate={EDate}&State={State}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`
- total `type: number` `length: -` `description: 총 검색결과 건수`
- perPage `type: number` `length: -` `description: 페이지 당 목록 건수`
- pageNum `type: number` `length: -` `description: 페이지 번호`
- pageCount `type: number` `length: -` `description: 페이지 개수`
- list `type: array` `length: -` `description: 전송결과 정보`
  - 최대 : 1,000건
  - subject `type: string` `length: 64` `description: 메시지 제목 (단위 : byte)`
    - 대체문자 내용이 90byte 초과한 경우에만 적용
    - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
  - content `type: string` `length: -` `description: 메시지 내용 (단위 : byte)`
    - 단문 : 90byte 이하 / 장문 : 2,000byte 이하
    - 2byte : 한글, 한자, 특수문자 / 1byte : 영문, 숫자, 공백
  - sendNum `type: string` `length: 20` `description: 발신번호`
  - senderName `type: string` `length: 70` `description: 발신자명`
  - receiveNum `type: string` `length: 20` `description: 수신번호`
  - receiveName `type: string` `length: 70` `description: 수신자명`
  - receiptDT `type: string` `length: 14` `description: 접수일시`
    - 형식 : yyyyMMddHHmmss
  - sendDT `type: string` `length: 14` `description: 전송일시`
    - 형식 : yyyyMMddHHmmss
  - resultDT `type: string` `length: 14` `description: 전송결과 수신일시`
    - 형식 : yyyyMMddHHmmss
  - reserveDT `type: string` `length: 14` `description: 예약일시`
    - 형식 : yyyyMMddHHmmss
  - state `type: number` `length: 1` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/sms/response-code#state-code)
  - result `type: number` `length: 3` `description: 결과코드`
    - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/sms/response-code#telecom-result-code)
  - type `type: string` `length: 3` `description: 메시지 타입`
    - `SMS`: 단문
    - `LMS`: 장문
    - `MMS`: 포토문자
  - tranNet `type: string` `length: 3` `description: 전송처리 이동통신사명`
  - receiptNum `type: string` `length: 18` `description: 접수번호`
  - requestNum `type: string` `length: 36` `description: 요청번호`
  - interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
    - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

**응답 예시**

```json
{
    "code": 1,
    "total": 19,
    "perPage": 500,
    "pageNum": 1,
    "pageCount": 1,
    "list": [
        {
            "content": "메시지 내용",
            "sendNum": "16008536",
            "receiveNum": "01012345678",
            "receiptDT": "20251027105545",
            "sendDT": "20251027105548",
            "resultDT": "20251027105551",
            "result": 100,
            "tranNet": "LGT",
            "receiptNum": "025102710000000006",
            "requestNum": "test001234",
            "state": 3,
            "type": "SMS"
        }
    ],
    "message": "검색 완료"
}
```

## 4. GetSentListURL - 문자 전송내역 팝업 URL

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

![문자 전송내역 팝업 URL 미리보기](https://developers.popbill.com/images/reference/message/getSentListURL.png)

**문자 전송내역 팝업 URL을 반환합니다.**

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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: 고정값 : BOX`

**요청 예시**

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

### Response

**응답 본문**

- url `type: string` `length: -` `description: 문자 전송내역 팝업 URL`

**응답 예시**

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

## 5. GetAutoDenyList - 080 수신거부 목록 확인

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

- 전용 080 번호에 등록된 수신거부 목록을 반환합니다.
- 080 수신 거부 서비스는 광고 문자 메시지에만 적용되며, 일반 문자 메시지에는 적용되지 않습니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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}/Message/Denied' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- number `type: string` `length: 20` `description: 수신거부번호`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
[
  {
    "number": "0801112222",
    "regDT": "20250206151252"
  }
]
```

## 6. CheckAutoDenyNumber - 080 번호 확인

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

- 팝빌회원에 등록된 080 수신거부 번호 정보를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/sms/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}/Message/AutoDenyNumberInfo' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- smsdenyNumber `type: string` `length: 20` `description: 전용 080 번호`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
{
    "smsdenyNumber": "0801112222",
    "regDT": "20250206151252"
}
```
