--- title: "Set result notifications" slug: "filesafer-programming-noti" tags: ["File Safer", "API"] updated: 2026-09-17T09:19:49Z published: 2026-09-17T09:19:49Z canonical: "guide.ncloud-docs.com/filesafer-programming-noti" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Set result notifications Available in Classic and VPC You can write codes that set scan result notifications using the REST API of Hash Filter and File Filter. Note Before developing File Filter, you need to subscribe to File Safer and API Gateway, and create an API Key. For more information, see [Getting started](/docs/en/filesafer-start). ## Scenario for setting scan result notifications The scenario for using the setNotiConfig API to set scan result notification is as follows: [1. Create authentication value](/docs/en/filesafer-programming-noti#1%EC%9D%B8%EC%A6%9D%EA%B0%92%EC%83%9D%EC%84%B1) [2. Create request body](/docs/en/filesafer-programming-noti#2%EC%9A%94%EC%B2%ADBody%EC%83%9D%EC%84%B1) [3. Request API](/docs/en/filesafer-programming-noti#3API%EC%9A%94%EC%B2%AD) Note - For information on setNotiConfig API specifications, see [setNotiConfig (Hash Filter/File Filter)](https://api.ncloud-docs.com/docs/en/security-filesafer-setnoticonfig). - To view the current settings, see [getNotiConfig (Hash Filter/File Filter)](https://api.ncloud-docs.com/docs/en/security-filesafer-getnoticonfig). ## Writing codes for setting scan result notifications Write the codes according to the scenario. setNotiConfig of Hash Filter and setNotiConfig of File Filter differ only in the request URI, and the authentication value and parameter settings are the same. ### 1. Create authentication value Create an IAM authentication value required for the NAVER Cloud Platform API use authentication. The headers required for authentication are as follows: - `x-ncp-iam-access-key`: Issue Access Key from the **My Account** > **Account and security management** > **Security management** > **Access management** menu on the console. - `x-ncp-apigw-signature-v2`: Create a signature value by HmacSHA256-encrypting the Secret Key mapped with the Access Key (use \n for a new-line character). - `x-ncp-apigw-api-key`: Issue API Key through API Gateway. - `x-ncp-apigw-timestamp`: Not an authentication value, but included in the request header. See API specifications. Note For information on how to create a signature value and example codes, see [NAVER Cloud Platform API guide > API overview > Basic API > Ncloud API > 2. Create header](https://api.ncloud-docs.com/docs/en/common-ncpapi). ### 2. Create request body Set notificationType, which is the result notification setting value, in the body of the setNotiConfig API. The notificationType setting value is as follows: | notificationType | Description | | --- | --- | | OFF | Do not notify. | | MAL | Notify when malware is detected (queried). | | MAE | Notify when malware is detected or query fails. | | ERR | Notify when query fails. | | ALL | Notify all. | ### 3. Request API Send the request to the Hash Filter setNotiConfig URI or File Filter setNotiConfig URI. - Hash Filter setNotiConfig URI: https://filesafer.apigw.ntruss.com/hashfilter/v1/setNotiConfig - File Filter setNotiConfig URI: https://filesafer.apigw.ntruss.com/filefilter/v1/setNotiConfig The following is an example code for requesting the Hash Filter setNotiConfig API: ``` 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); } } ``` Note You can also use the advanced settings feature to receive notifications of analysis results. This feature notifies you when malware detections reach the specified threshold within a set period. For detailed information about this API, see [setThresholdNotiConfig (Hash Filter/File Filter)](https://api.ncloud-docs.com/docs/en/security-filesafer-setthresholdnoticonfig).