# 전송결과

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

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

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

### Request

**요청 헤더**

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

### Response

**응답 본문**

- state `type: number` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/fax/response-code#state-code)
- result `type: number` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/fax/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: number` `length: -` `description: 전체 페이지수`
- successPageCnt `type: number` `length: -` `description: 성공 페이지수`
- failPageCnt `type: number` `length: -` `description: 실패 페이지수`
- cancelPageCnt `type: number` `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: array` `length: -` `description: 전송 파일명 리스트`
  - 최대 : 30개
- receiptNum `type: string` `length: 18` `description: 팝빌에서 할당한 접수번호`
- requestNum `type: string` `length: 36` `description: 파트너가 할당한 요청번호`
- interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
  - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
- chargePageCnt `type: number` `length: -` `description: 과금 페이지수`
- refundPageCnt `type: number` `length: -` `description: 환불 페이지수`
- tiffFileSize `type: string` `length: -` `description: 변환파일용량`
  - 단위 : byte

**응답 예시**

```json
[
    {
        "state": 1,
        "sendNum": "16008536",
        "receiveNum": "02-6442-9700",
        "receiveName": "링크허브",
        "receiptDT": "20251022151211",
        "fileNames": [
            "test.pdf"
        ],
        "receiptNum": "025102215121100001",
        "receiveNumType": "일반"
    }
]
```

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

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

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

### Request

**요청 헤더**

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

### Response

**응답 본문**

- state `type: number` `length: 1` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/fax/response-code#state-code)
- result `type: number` `length: 3` `description: 결과코드`
  - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/fax/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: number` `length: -` `description: 전체 페이지수`
- successPageCnt `type: number` `length: -` `description: 성공 페이지수`
- failPageCnt `type: number` `length: -` `description: 실패 페이지수`
- cancelPageCnt `type: number` `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: array` `length: -` `description: 전송 파일명 리스트`
  - 최대 : 30개
- receiptNum `type: string` `length: 18` `description: 팝빌에서 할당한 접수번호`
- requestNum `type: string` `length: 36` `description: 파트너가 할당한 요청번호`
- interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
  - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
- chargePageCnt `type: number` `length: -` `description: 과금 페이지수`
- refundPageCnt `type: number` `length: -` `description: 환불 페이지수`
- tiffFileSize `type: string` `length: -` `description: 변환파일용량`
  - 단위 : byte

**응답 예시**

```json
[
    {
        "state": 1,
        "sendNum": "16008536",
        "receiveNum": "02-6442-9700",
        "receiveName": "링크허브",
        "receiptDT": "20251022152215",
        "fileNames": [
            "test.pdf"
        ],
        "receiptNum": "025102215221500001",
        "requestNum": "REQNUM-20251022152214",
        "receiveNumType": "일반"
    }
]
```

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

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

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

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/fax/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: N` `description: 전송상태 (다중 선택 가능)`
  - `1`: 대기
  - `2`: 성공
  - `3`: 실패
  - `4`: 취소
  - 다중 선택시 콤마(',')로 구분. 예) 1,2
- 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}/FAX/Search?SDate={SDate}&EDate={EDate}' \
  --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건
  - state `type: number` `length: 1` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/fax/response-code#state-code)
  - result `type: number` `length: 3` `description: 결과코드`
    - [\[참고\] 통신사 결과코드](https://developers.popbill.com/api-reference/fax/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: number` `length: -` `description: 전체 페이지수`
  - successPageCnt `type: number` `length: -` `description: 성공 페이지수`
  - failPageCnt `type: number` `length: -` `description: 실패 페이지수`
  - cancelPageCnt `type: number` `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: array` `length: -` `description: 전송 파일명 리스트`
    - 최대 : 30개
  - receiptNum `type: string` `length: 18` `description: 팝빌에서 할당한 접수번호`
  - requestNum `type: string` `length: 36` `description: 파트너가 할당한 요청번호`
  - interOPRefKey `type: string` `length: 20` `description: 파트너 지정키`
    - 팩스 대량/동보전송시 파트너가 개별건마다 입력할 수 있는 값
  - chargePageCnt `type: number` `length: -` `description: 과금 페이지수`
  - refundPageCnt `type: number` `length: -` `description: 환불 페이지수`
  - tiffFileSize `type: string` `length: -` `description: 변환파일용량`
    - 단위 : byte

**응답 예시**

```json
{
    "code": 1,
    "total": 99,
    "perPage": 500,
    "pageNum": 1,
    "pageCount": 1,
    "list": [
        {
            "state": 3,
            "sendNum": "02-6442-9700",
            "receiveNum": "1234",
            "title": "현금영수증 [025092319355600001]",
            "sendPageCnt": 1,
            "successPageCnt": 0,
            "failPageCnt": 1,
            "chargePageCnt": 1,
            "refundPageCnt": 1,
            "receiptDT": "20250929103337",
            "sendDT": "20250929103648",
            "resultDT": "20250929103657",
            "result": 504,
            "fileNames": [
                "025092319355600001.pdf"
            ],
            "tiffFileSize": "10079",
            "receiptNum": "025092910333700001",
            "receiveNumType": "지능"
        }
    ],
    "message": "검색 완료"
}
```

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

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

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

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

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/fax/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}/FAX?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. GetPreviewURL - 팩스 변환파일 확인 팝업 URL

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

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

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

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

### Request

**요청 헤더**

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

### Response

**응답 본문**

- url `type: string` `length: -` `description: 팩스 변환파일 확인 팝업 URL`

**응답 예시**

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