getMailRequestList

Prev Next

Classic/VPC 환경에서 이용 가능합니다.

이메일 발송을 요청한 내역 목록을 조회합니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

메서드 URI
GET /mails/requests

요청 헤더

Cloud Outbound Mailer API에서 공통으로 사용하는 헤더에 대한 자세한 내용은 Cloud Outbound Mailer 요청 헤더를 참조해 주십시오.

요청 쿼리 파라미터

파라미터에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
startUtc Long Conditional 조회할 요청 내역의 시작 일시
  • 1970년 1월 1일 00:00:00 협정 세계시(UTC)부터의 경과 시간을 1/1000초로 환산한 정수
  • startUtc 또는 startDateTime 입력 필수
  • startDateTime 값보다 우선 적용
startDateTime String Conditional 조회할 요청 내역의 시작 일시(UTC+9:00)
  • 허용 포맷
    • yyyy-MM-dd
    • yyyy-MM-dd HH:mm
    • yyyy-MM-dd HH:mm:ss.SSS
    • yyyy-MM-dd HH:mm:ss SSS
  • startUtc 또는 startDateTime 입력 필수
  • startUtc 값이 우선 적용
endUtc Long Conditional 조회할 요청 내역의 종료 일시
  • 1970년 1월 1일 00:00:00 협정 세계시(UTC)부터의 경과 시간을 1/1000초로 환산한 정수
  • endUtc 또는 endDateTime 입력 필수
  • endDateTime 값보다 우선 적용
endDateTime String Conditional 조회할 요청 내역의 종료 일시(UTC+9:00)
  • 허용 포맷
    • yyyy-MM-dd
    • yyyy-MM-dd HH:mm
    • yyyy-MM-dd HH:mm:ss.SSS
    • yyyy-MM-dd HH:mm:ss SSS
  • endUtc 또는 endDateTime 입력 필수
  • endUtc 값이 우선 적용
requestId String Optional 각 요청을 구분하기 위한 이메일 발송 요청 ID
  • 한 번에 여러 건의 이메일 발송을 요청할 경우, requestId는 여러 개의 mailId를 포함할 수 있음
mailId String Optional 각 이메일을 식별하기 위한 고유한 ID
dispatchType String Optional 이메일 발송을 요청할 때 사용된 도구
  • CONSOLE | API
title String Optional 이메일의 제목
  • like 검색 지원
templateSid Integer Optional 이메일 작성에 사용된 템플릿의 SID
senderAddress String Optional 발송자 이메일 주소
recipientAddress String Optional 수신자 이메일 주소
sendStatus List<String> Optional 이메일 발송 상태
  • P |R | I | S | F | U | C | PF
    • P: 발송 준비 중
    • R: 발송 준비
    • I: 발송 중
    • S: 발송 성공
    • F: 발송 실패
    • U: 수신 거부
    • C: 발송 취소
    • PF: 일부 실패
size Integer Optional 페이지당 레코드 개수
  • 10 (기본값)
page Integer Optional 조회할 페이지 인덱스
  • 0 이상
sort String Optional 정렬 기준
  • createUtc | recipientCount | reservationUtc | sendUtc | statusCode
    • createUtc: 생성 일시
    • recipientCount: 수신자 수
    • reservationUtc: 발송 예약 일시
    • sendUtc: 발송 완료 일시
    • statusCode: 발송 상태
  • property(,asc|desc) 형식
    • asc (기본값)
  • 복수의 정렬 기준 설정 가능

요청 예시

요청 예시는 다음과 같습니다.

curl --location --request GET 'https://mail.apigw.gov-ntruss.com/api/v1/mails/requests
?dispatchType=API
&startDateTime=2018-11-01%2000:00
&size=5
&sendStatus=S
&page=0
&endDateTime=2018-11-20%2023:59'
--header 'x-ncp-apigw-timestamp: {Timestamp}'
--header 'x-ncp-iam-access-key: {Access Key}'
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

응답

응답 형식을 설명합니다.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
content List<RequestListResponse> Optional 요청 내역 목록에 대한 상세 내용
last Boolean Required 마지막 페이지인지의 여부
totalElements Integer Required 총 레코드 개수
totalPages Integer Required 총 페이지 수
first Boolean Required 첫 번째 페이지인지의 여부
numberOfElements Integer Required 현재 페이지의 레코드 개수
size Integer Required 페이지당 레코드 개수
number Integer Required 현재 페이지의 인덱스 (0부터 시작)
sort List<Sort> Required 정렬 기준

응답 상태 코드

응답 상태 코드에 대한 설명은 다음과 같습니다.

HTTP 상태 코드 코드 설명
200 - 요청 성공
400 - 인증 실패, 잘못된 요청
400 77101 로그인 정보 오류
400 77102 요청 오류
400 77103 요청한 리소스가 존재하지 않음
403 77201 요청한 리소스에 대한 권한이 없음
403 77202 이메일 서비스 사용을 신청하지 않은 사용자가 호출한 경우
405 77001 지원되지 않는 메서드 유형
415 77002 지원되지 않는 미디어 유형
500 - 서버 오류
500 77301 기본 프로젝트가 존재하지 않음
500 77302 외부 시스템 API 연동 오류
500 77303 그 외 내부 서버 오류

응답 예시

응답 예시는 다음과 같습니다.

{
  "content":[
    {
      "requestId":"20181120000000000299",
      "requestDate":{
        "utc":1542675575268,
        "formattedDate":"2018-11-20",
        "formattedDateTime":"2018-11-20 09:59:35 268"
      },
      "templateSid":null,
      "templateName":null,
      "emailStatus":{
        "label":"발송성공",
        "code":"S"
      },
      "senderAddress":"no_reply@domain.com",
      "senderName":null,
      "dispatchType":"API",
      "elapsedTime":"00:00:05.230",
      "sendDate":{
        "utc":1542675580498,
        "formattedDate":"2018-11-20",
        "formattedDateTime":"2018-11-20 09:59:40 498"
      },
      "reservationDate":null,
      "requestCount":100,
      "recipientCount":100
    },
    {
      "requestId":"20181113000000000499",
      "requestDate":{
        "utc":1542071645647,
        "formattedDate":"2018-11-13",
        "formattedDateTime":"2018-11-13 10:14:05 647"
      },
      "templateSid":null,
      "templateName":null,
      "emailStatus":{
        "label":"발송성공",
        "code":"S"
      },
      "senderAddress":"a@a.com",
      "senderName":null,
      "dispatchType":"API",
      "elapsedTime":"00:00:00.475",
      "sendDate":{
        "utc":1542071646122,
        "formattedDate":"2018-11-13",
        "formattedDateTime":"2018-11-13 10:14:06 122"
      },
      "reservationDate":null,
      "requestCount":1,
      "recipientCount":1
    },
    {
      "requestId":"20181113000000000299",
      "requestDate":{
        "utc":1542071618910,
        "formattedDate":"2018-11-13",
        "formattedDateTime":"2018-11-13 10:13:38 910"
      },
      "templateSid":null,
      "templateName":null,
      "emailStatus":{
        "label":"발송성공",
        "code":"S"
      },
      "senderAddress":"a@a.com",
      "senderName":null,
      "dispatchType":"API",
      "elapsedTime":"00:00:02.142",
      "sendDate":{
        "utc":1542071621052,
        "formattedDate":"2018-11-13",
        "formattedDateTime":"2018-11-13 10:13:41 052"
      },
      "reservationDate":null,
      "requestCount":1,
      "recipientCount":1
    },
    {
      "requestId":"20181109000063986599",
      "requestDate":{
        "utc":1541752179226,
        "formattedDate":"2018-11-09",
        "formattedDateTime":"2018-11-09 17:29:39 226"
      },
      "templateSid":13,
      "templateName":"test",
      "emailStatus":{
        "label":"발송성공",
        "code":"S"
      },
      "senderAddress":"no_reply@a.com",
      "senderName":"test",
      "dispatchType":"API",
      "elapsedTime":"00:15:02.312",
      "sendDate":{
        "utc":1541753081538,
        "formattedDate":"2018-11-09",
        "formattedDateTime":"2018-11-09 17:44:41 538"
      },
      "reservationDate":null,
      "requestCount":100000,
      "recipientCount":100000
    },
    {
      "requestId":"20181109000063886499",
      "requestDate":{
        "utc":1541752150850,
        "formattedDate":"2018-11-09",
        "formattedDateTime":"2018-11-09 17:29:10 850"
      },
      "templateSid":13,
      "templateName":"test",
      "emailStatus":{
        "label":"발송성공",
        "code":"S"
      },
      "senderAddress":"no_reply@a.com",
      "senderName":"test",
      "dispatchType":"API",
      "elapsedTime":"00:00:17.004",
      "sendDate":{
        "utc":1541752167854,
        "formattedDate":"2018-11-09",
        "formattedDateTime":"2018-11-09 17:29:27 854"
      },
      "reservationDate":null,
      "requestCount":1000,
      "recipientCount":1000
    }
  ],
  "last":false,
  "totalElements":21,
  "totalPages":5,
  "first":true,
  "numberOfElements":5,
  "sort":[
    {
      "direction":"DESC",
      "property":"createUtc",
      "ignoreCase":false,
      "nullHandling":"NATIVE",
      "ascending":false,
      "descending":true
    }
  ],
  "size":5,
  "number":0
}