본문으로 건너뛰기
버전: 개발 버전 (최신)

최신 export 기록 조회 API (v2)

최신 export 기록 조회 API는 인증된 사용자의 채널별(LOCAL | EPA) 가장 최근 1건 의 health-data export 기록을 조회하는 v2 endpoint입니다. 채널은 path 로 고정되므로 별도 쿼리 파라미터/검증(400)이 없으며, 해당 채널 이력이 없으면 HTTP 200 + 응답 바디 null 을 반환합니다.

핵심
  • 채널별 경로 분리: GET .../local/latest(LOCAL), GET .../epa/latest(EPA). 두 endpoint는 채널만 다르고 응답 스키마는 동일합니다.
  • 이력 없음 = 200 + null: 해당 채널 이력이 없으면 status 200 그대로 응답 바디가 null 입니다.
  • DB read only: 조회만 수행하므로 사전조건(active cycle 등) 검증이 없습니다.
인증 정책 (v2 공통)
  • 인증 채널은 Authorization: Bearer <accessToken> 한 줄(JwtAuthGuard).
  • 채널은 path 로 고정되므로 Query Parameter / Request Body 가 없습니다.

GET /v2/health-data/export/local/latest

인증된 사용자의 LOCAL 채널 최신 export 기록 1건을 조회합니다.

  • Path: GET /v2/health-data/export/local/latest
  • 인증: User Access Token (JwtAuthGuard)
  • Rate Limit: 60/분 (전역 default)
  • 🔗 라이브 명세 (Swagger UI): dev

Request

HeaderValue
AuthorizationBearer <accessToken> (필수)

요청 본문/쿼리 없음. 채널은 path(local)로 고정됩니다.

Response 200 OK — LatestExportResponseDto

{
"channel": "LOCAL",
"status": "SUCCEEDED",
"requestedAt": 1749031200000,
"completedAt": 1749031205000
}

이력이 없으면 응답 바디는 null 입니다(status 200 동일).

필드타입필수설명
channelstringYesexport 채널 (LOCAL | EPA) — 요청 path 에 대응
statusstringYesexport 결과 (SUCCEEDED | FAILED)
requestedAtnumberYesexport 요청 시각 unix timestamp(ms, 13자리)
completedAtnumber | nullNoexport 완료 시각 unix timestamp(ms, 13자리). 미완료 시 null

Errors

HTTPcodemessage발생 조건
4011000Authentication token not foundBearer access token 미제공 (JwtAuthGuard)
4011000Invalid or expired tokenaccess token 만료/서명·검증 실패 (JwtAuthGuard)
4011000Invalid token: missing subject (user ID)payload에 userId(sub) 없음
4011000User ID not found in requestguard 통과했으나 req.user.userId 부재 (컨트롤러)
50021000(빈 값)export 기록 조회 중 예상치 못한 서버 오류
5001000An unexpected error occurred그 외 미처리 예외 (global exception filter fallback)

GET /v2/health-data/export/epa/latest

인증된 사용자의 EPA 채널 최신 export 기록 1건을 조회합니다. 응답 스키마·에러는 위 LOCAL 조회와 동일하며 channel 값만 EPA 입니다.

  • Path: GET /v2/health-data/export/epa/latest
  • 인증: User Access Token (JwtAuthGuard)
  • Rate Limit: 60/분 (전역 default)
  • 🔗 라이브 명세 (Swagger UI): dev

Request

HeaderValue
AuthorizationBearer <accessToken> (필수)

요청 본문/쿼리 없음. 채널은 path(epa)로 고정됩니다.

Response 200 OK — LatestExportResponseDto

{
"channel": "EPA",
"status": "SUCCEEDED",
"requestedAt": 1749031200000,
"completedAt": 1749031205000
}

이력이 없으면 응답 바디는 null 입니다. 필드 상세는 위 GET .../local/latest 의 응답 표를 참조하세요.

Errors

위 LOCAL 조회와 동일합니다(401 4종 + 500 21000 / 1000).


다음 단계