--- title: "결과 통보 설정" slug: "filesafer-programming-noti" tags: ["api", "File Safer"] updated: 2026-07-23T09:02:51Z published: 2026-07-23T09:02:51Z canonical: "guide-fin.ncloud-docs.com/filesafer-programming-noti" --- > ## Documentation Index > Fetch the complete documentation index at: https://guide-fin.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # 결과 통보 설정

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

Hash Filter, File Filter의 REST API를 사용하여 검사 결과 통보 설정 코드를 작성하는 방법을 설명합니다. :::(Info) (참고) File Filter 개발에 앞서 File Safer 이용 신청, API Gateway 이용 신청 및 API Key 생성을 해야 합니다. 자세한 내용은 [File Safer 시작](/docs/filesafer-start)을 참고해 주십시오. ::: ## 검사 결과 통보 설정 시나리오 setNotiConfig API를 사용하여 검사 결과 통보를 설정하는 시나리오는 다음과 같습니다. ![filesafer-programming-noti_scenario_ko](https://cdn.document360.io/0406ed95-101f-4cde-8dd8-308d03444a94/Images/Documentation/filesafer-programming_noti-scenario_ko.png){height="" width="70%"} [1. 인증값 생성](#1인증값생성) [2. 요청 Body 생성](#2요청Body생성) [3. API 요청](#3API요청) :::(Info) (참고) * setNotiConfig API 명세는 [setNotiConfig (Hash Filter/File Filter)](https://api-fin.ncloud-docs.com/docs/security-filesafer-setnoticonfig){target="_blank"}를 참고해 주십시오. * 현재 설정된 값을 확인하려면 [getNotiConfig (Hash Filter/File Filter)](https://api-fin.ncloud-docs.com/docs/security-filesafer-getnoticonfig){target="_blank"}를 참고해 주십시오. ::: ## 검사 결과 통보 설정 코드 작성 시나리오에 따라 코드를 작성해 주십시오. Hash Filter의 setNotiConfig와 File Filter의 setNotiConfig는 요청 URI만 다르고 인증값 및 파라미터 설정은 동일합니다. ### 1. 인증값 생성 네이버 클라우드 플랫폼 API 사용 인증에 필요한 IAM 인증값을 생성해 주십시오. 인증에 필요한 헤더는 다음과 같습니다. * `x-ncp-iam-access-key`: 네이버 클라우드 플랫폼 콘솔의 우측 상단 **My Account** > **계정 및 보안 관리** > **보안 관리** > **접근 관리** > **API 인증키** 메뉴에서 Access Key 발급 * `x-ncp-apigw-signature-v2` : Access Key와 매핑되는 Secret Key를 HmacSHA256 암호화하여 signature 값 생성 (개행 문자는 \n 사용) * `x-ncp-apigw-api-key` : API Gateway를 통해 API Key 발급 * `x-ncp-apigw-timestamp` : 인증값은 아니지만 요청 헤더에 포함. API 명세 참고. :::(Info) (참고) signature 값을 생성하는 방법과 예제 코드는 [네이버 클라우드 플랫폼 API 가이드 > API 개요 > 기본 API > Ncloud API > 2.헤더 생성](https://api-fin.ncloud-docs.com/docs/common-ncpapi){target="_blank"}를 참조하시기 바랍니다. ::: ### 2. 요청 Body 생성 setNotiConfig API의 Body에 결과 통보 설정값인 notificationType을 설정해 주십시오. notificationType 설정 값은 다음과 같습니다. | notificationType | 설명 | | :--- | :--- | | OFF | 통보하지 않음 | | MAL | 악성 코드 탐지(조회) 시 통보 | | MAE | 악성 코드 탐지 시 또는 조회 실패 시 통보 | | ERR | 조회 실패 시 통보 | | ALL | 모두 통보 | ### 3. API 요청 Hash Filter setNotiConfig URI 또는 File Filter setNotiConfig URI로 요청을 전송해 주십시오. * Hash Filter setNotiConfig URI: https://fin-filesafer.apigw.fin-ntruss.com/hashfilter/v1/setNotiConfig * File Filter setNotiConfig URI: https://fin-filesafer.apigw.fin-ntruss.com/filefilter/v1/setNotiConfig 다음은 Hash Filter setNotiConfig API 요청 예제 코드입니다. ```Java public void setNotiConfig() throws Exception { String ACCESSKEY = "AAAAAAAAAAAAAAAAAAAA"; // access key (from portal or sub account) String apikey = API_GATEWAY_KEY; long timestamp = System.currentTimeMillis(); String method = "POST"; String apiURL = "/hashfilter/v1/setNotiConfig"; String signature = makeSignature(method, apiURL, timestamp); URL url = new URL(apiDomain + apiURL); HttpURLConnection con = (HttpURLConnection)url.openConnection(); con.setDoOutput(true); con.setRequestMethod(method); con.setRequestProperty("x-ncp-apigw-timestamp", Long.toString(timestamp)); con.setRequestProperty("x-ncp-iam-access-key", ACCESSKEY); con.setRequestProperty("x-ncp-apigw-signature-v2", signature); con.setRequestProperty("x-ncp-apigw-api-key", apikey); con.setRequestProperty("Content-Type", "application/json"); con.setRequestProperty("accept", "application/json"); // write request body DataOutputStream dos = new DataOutputStream(con.getOutputStream()); dos.writeBytes("{\r\n"); dos.writeBytes(" \"notificationType\": \"ALL\"\r\n"); dos.writeBytes("}"); // read http response code int responseCode = con.getResponseCode(); BufferedReader br = null; if(responseCode == 200) { br = new BufferedReader(new InputStreamReader(con.getInputStream())); } else { br = new BufferedReader(new InputStreamReader(con.getErrorStream())); } // read http response body String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = br.readLine()) != null) { response.append(inputLine); } } ``` :::(Info) (참고) 분석 결과를 통보받기 위해 고급 설정 기능을 사용할 수도 있습니다. 고급 설정은 일정 시간 동안 임계치에 해당하는 악성 코드가 탐지되면 통보하는 기능입니다.해당 API에 대한 자세한 설명은 [setThresholdNotiConfig (Hash Filter/File Filter)](https://api-fin.ncloud-docs.com/docs/security-filesafer-setthresholdnoticonfig){target="_blank"}를 확인해 주십시오. :::