# 전송결과

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

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

```pascal
function GetMessages(CorpNum : String; receiptNum : String; UserID : String = '') : TSentMessageList;
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- receiptNum `type: String` `length: 18` `required: Y` `description: 팝빌에서 할당한 접수번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**TSentMessage**

- 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: String` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/sms/delphi/response-code#state-code)
- result `type: String` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/sms/delphi/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: 파트너 지정키`
  - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

### 예외

**EPopbillException**

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

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

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

```pascal
function GetMessagesRN(CorpNum : String; requestNum : String; UserID : String = '') : TSentMessageList;
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- requestNum `type: String` `length: 36` `required: Y` `description: 파트너가 할당한 요청번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**TSentMessage**

- 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: String` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/sms/delphi/response-code#state-code)
- result `type: String` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/sms/delphi/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: 파트너 지정키`
  - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

### 예외

**EPopbillException**

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

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

검색조건에 해당하는 문자 전송내역을 조회합니다. (조회기간 단위 : 최대 2개월)

- 문자 접수일시로부터 12개월 이내 접수건만 조회할 수 있습니다.

```pascal
function Search(CorpNum : String; SDate : String; EDate : String; State : Array Of String; Item : Array Of String; ReserveYN : boolean; SenderYN : boolean; Page : Integer; PerPage : Integer; Order : String; QString : String; UserID : String) : TSearchList;
```

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

### 요청

**Parameters**

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

### 응답

**TSearchList**

- code `type: long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- total `type: Integer` `length: -` `description: 총 검색결과 건수`
- perPage `type: Integer` `length: -` `description: 페이지당 목록 건수`
- pageNum `type: Integer` `length: -` `description: 페이지 번호`
- pageCount `type: Integer` `length: -` `description: 페이지 개수`
- list `type: TSentMessage` `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: String` `length: 1` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/sms/delphi/response-code#state-code)
  - result `type: String` `length: 3` `description: 결과코드`
    - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/sms/delphi/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: 파트너 지정키`
    - 문자 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값

### 예외

**EPopbillException**

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

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

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

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

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

```pascal
function GetSentListURL(CorpNum : String; UserID : String) : String;
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**EPopbillException**

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

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

전용 080 번호에 등록된 수신거부 목록을 반환합니다.

- 080 수신 거부 서비스는 광고 문자 메시지에만 적용되며, 일반 문자 메시지에는 적용되지 않습니다.

```pascal
function GetAutoDenyList(CorpNum : String) : TAutoDenyList;
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`

### 응답

**Array Of TAutoDenyInfo**

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

### 예외

**EPopbillException**

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