# 전송결과

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

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

```vb
Function GetMessages(CorpNum As String, receiptNum As String, Optional UserID As String = "") As Collection
```

### 요청

**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: 팝빌회원 아이디`

### 응답

**PBFaxInfo**

- state `type: Integer` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/fax/vba/response-code#state-code)
- result `type: Integer` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/fax/vba/response-code#result-code)
  - {state} = 3 경우 팩스 전송결과 확인 가능
- sendNum `type: String` `length: 20` `description: 발신번호`
- senderName `type: String` `length: 100` `description: 발신자명`
- receiveNum `type: String` `length: 20` `description: 수신번호`
- receiveNumType `type: String` `length: 2` `description: 수신번호 유형`
  - `일반`: 일반망 (지능망을 제외한 번호)
  - `지능`: 지능망 (030\*, 050\*, 070\*, 080\*, 대표번호)
- receiveName `type: String` `length: 30` `description: 수신자명`
- title `type: String` `length: 100` `description: 팩스제목`
- sendPageCnt `type: Integer` `length: -` `description: 전체 페이지수`
- successPageCnt `type: Integer` `length: -` `description: 성공 페이지수`
- failPageCnt `type: Integer` `length: -` `description: 실패 페이지수`
- cancelPageCnt `type: Integer` `length: -` `description: 취소 페이지수`
- reserveDT `type: String` `length: 14` `description: 예약일시`
  - 형식 : yyyyMMddHHmmss
- receiptDT `type: String` `length: 14` `description: 접수일시`
  - 형식 : yyyyMMddHHmmss
- sendDT `type: String` `length: 14` `description: 전송일시`
  - 형식 : yyyyMMddHHmmss
- resultDT `type: String` `length: 14` `description: 전송결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- fileNames `type: Collection` `length: 30` `description: 전송 파일명 리스트`
- receiptNum `type: String` `length: 18` `description: 팝빌에서 할당한 접수번호`
- requestNum `type: String` `length: 36` `description: 파트너가 할당한 요청번호`
- interOPRefKey `type: String` `length: 20` `description: 파트너 지정키`
  - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
- chargePageCnt `type: Integer` `length: -` `description: 과금 페이지수`
- refundPageCnt `type: Integer` `length: -` `description: 환불 페이지수`
- tiffFileSize `type: String` `length: -` `description: 변환파일용량`
  - 단위 : byte

### 예외

**Err**

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

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

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

```vb
Function GetMessagesRN(CorpNum As String, requestNum As String, Optional UserID As String = "") As Collection
```

### 요청

**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: 팝빌회원 아이디`

### 응답

**PBFaxInfo**

- state `type: Integer` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/fax/vba/response-code#state-code)
- result `type: Integer` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/fax/vba/response-code#result-code)
  - {state} = 3 경우 팩스 전송결과 확인 가능
- sendNum `type: String` `length: 20` `description: 발신번호`
- senderName `type: String` `length: 100` `description: 발신자명`
- receiveNum `type: String` `length: 20` `description: 수신번호`
- receiveNumType `type: String` `length: 2` `description: 수신번호 유형`
  - `일반`: 일반망 (지능망을 제외한 번호)
  - `지능`: 지능망 (030\*, 050\*, 070\*, 080\*, 대표번호)
- receiveName `type: String` `length: 30` `description: 수신자명`
- title `type: String` `length: 100` `description: 팩스제목`
- sendPageCnt `type: Integer` `length: -` `description: 전체 페이지수`
- successPageCnt `type: Integer` `length: -` `description: 성공 페이지수`
- failPageCnt `type: Integer` `length: -` `description: 실패 페이지수`
- cancelPageCnt `type: Integer` `length: -` `description: 취소 페이지수`
- reserveDT `type: String` `length: 14` `description: 예약일시`
  - 형식 : yyyyMMddHHmmss
- receiptDT `type: String` `length: 14` `description: 접수일시`
  - 형식 : yyyyMMddHHmmss
- sendDT `type: String` `length: 14` `description: 전송일시`
  - 형식 : yyyyMMddHHmmss
- resultDT `type: String` `length: 14` `description: 전송결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- fileNames `type: Collection` `length: 30` `description: 전송 파일명 리스트`
- receiptNum `type: String` `length: 18` `description: 팝빌에서 할당한 접수번호`
- requestNum `type: String` `length: 36` `description: 파트너가 할당한 요청번호`
- interOPRefKey `type: String` `length: 20` `description: 파트너 지정키`
  - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
- chargePageCnt `type: Integer` `length: -` `description: 과금 페이지수`
- refundPageCnt `type: Integer` `length: -` `description: 환불 페이지수`
- tiffFileSize `type: String` `length: -` `description: 변환파일용량`
  - 단위 : byte

### 예외

**Err**

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

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

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

- 팩스 접수일시로부터 6개월 이내 접수건만 조회할 수 있습니다.

```vb
Function Search(CorpNum As String, SDate As String, EDate As String, state As Collection, ReserveYN As Boolean, SenderOnly As Boolean, Page As Integer, PerPage As Integer, Order As String, Optional QString As String = "") As PBFaxSearchList
```

> 매개변수 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: Collection` `length: -` `required: N` `description: 전송상태 (다중 선택 가능)`
  - `1`: 대기
  - `2`: 성공
  - `3`: 실패
  - `4`: 취소
  - 기본값 : 전체조회
- ReserveYN `type: Boolean` `length: -` `required: N` `description: 예약여부`
  - `true`: 예약전송건
  - `false`: 즉시전송건
  - 기본값 : 전체조회
- SenderOnly `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: N` `description: 팩스 접수일시를 기준으로 하는 목록 정렬 방향`
  - `D`: 내림차순 : 기본값
  - `A`: 오름차순
- QString `type: String` `length: -` `required: N` `description: 조회 검색어(발신자명, 수신자명, 수신번호)`
  - 기본값 : 전체조회

### 응답

**PBFaxSearchList**

- code `type: Integer` `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: PBFaxInfo[ ]` `length: -` `description: 전송결과 정보`
  - 최대 : 1,000건
  - state `type: Integer` `length: 1` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/fax/vba/response-code#state-code)
  - result `type: Integer` `length: 3` `description: 결과코드`
    - [\[참고\] 통신사 결과코드](https://developers.popbill.com/reference/fax/vba/response-code#result-code)
    - {state} = 3 경우 팩스 전송결과 확인 가능
  - sendNum `type: String` `length: 20` `description: 발신번호`
  - senderName `type: String` `length: 100` `description: 발신자명`
  - receiveNum `type: String` `length: 20` `description: 수신번호`
  - receiveNumType `type: String` `length: 2` `description: 수신번호 유형`
    - `일반`: 일반망 (지능망을 제외한 번호)
    - `지능`: 지능망 (030\*, 050\*, 070\*, 080\*, 대표번호)
  - receiveName `type: String` `length: 30` `description: 수신자명`
  - title `type: String` `length: 100` `description: 팩스제목`
  - sendPageCnt `type: Integer` `length: -` `description: 전체 페이지수`
  - successPageCnt `type: Integer` `length: -` `description: 성공 페이지수`
  - failPageCnt `type: Integer` `length: -` `description: 실패 페이지수`
  - cancelPageCnt `type: Integer` `length: -` `description: 취소 페이지수`
  - reserveDT `type: String` `length: 14` `description: 예약일시`
    - 형식 : yyyyMMddHHmmss
  - receiptDT `type: String` `length: 14` `description: 접수일시`
    - 형식 : yyyyMMddHHmmss
  - sendDT `type: String` `length: 14` `description: 전송일시`
    - 형식 : yyyyMMddHHmmss
  - resultDT `type: String` `length: 14` `description: 전송결과 수신일시`
    - 형식 : yyyyMMddHHmmss
  - fileNames `type: Collection` `length: 30` `description: 전송 파일명 리스트`
  - receiptNum `type: String` `length: 18` `description: 팝빌에서 할당한 접수번호`
  - requestNum `type: String` `length: 36` `description: 파트너가 할당한 요청번호`
  - interOPRefKey `type: String` `length: 20` `description: 파트너 지정키`
    - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
  - chargePageCnt `type: Integer` `length: -` `description: 과금 페이지수`
  - refundPageCnt `type: Integer` `length: -` `description: 환불 페이지수`
  - tiffFileSize `type: String` `length: -` `description: 변환파일용량`
    - 단위 : byte

### 예외

**Err**

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

## 4. GetSentListURL - 팩스 전송내역 팝업 URL

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

**팩스 전송내역 팝업 URL을 반환합니다.**

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

```vb
Function GetSentListURL(CorpNum As String, UserID As String) As String
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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

## 5. GetPreviewURL - 팩스 변환파일 확인 팝업 URL

![팩스 변환파일 확인 팝업 URL 미리보기](https://developers.popbill.com/images/reference/fax/getPreviewURL.png)

**팩스 1건의 변환파일을 확인하는 팝업 URL을 반환합니다.**

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

```vb
Function GetPreviewURL(CorpNum As String, receiptNum As String, UserID As String) As String
```

### 요청

**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: 팝빌회원 아이디`

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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