ADDRESS  26, Sambugol-ro, Gwacheon-si, Gyeonggi-do, Republic of Korea
 +82-31-697-4501

© 2019 SHIELDEX Co.,Ltd.

SHIELDEX WebAPI Guide

SHIELDEX's WebAPI is provided in two ways, and can be selected according to the implementation method.

Each of the logic flow is as follows:

Document Sanitization (CDR) completion notification method

  1. Request CDR using form-data transferring method

  2. CDR processed File and its result are notified by callback method.

  • Web server development required to receive notification of CDR processing.

Document Sanitization (CDR) completion check method

  1. Request CDR processing via using form-data transferring method

  2. Response with job ID for CDR request

  3. Check whether CDR processing is completed with using job ID or not

  4. File download request when CDR process is completed

  • Download request with frequent checking of CDR completion which can be performed by a testing tool like “Postman”.

Document Sanitization (CDR) completion notification method (ver.2)
CDR Processing Request
You can easily make document CDR requests by using form-data transfer.
/v2/Sanitize
[ Request ]
POST
http://{SHIELDEX_address}:8087/SDFileProxy/v2/Sanitize
CDR Request Parameters

{

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"SVR_IP":"{svr_ip}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}

HTTP

POST /SDFileProxy/v2/Sanitize HTTP/1.1

Host: {SHIELDEX_address}:8087

Content-Type: multipart/form-data;

Content-Disposition: form-data; name="json"

{

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"SVR_IP":"{svr_ip}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}

Content-Disposition: form-data; name="files";

filename=”{upload_file}

cURL

curl -X POST \

  http://{SHIELDEX_address}:8087/SDFileProxy/v2/Sanitize \

  -H 'content-type: multipart/form-data;

  -F 'json={

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"SVR_IP":"{svr_ip}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}' \

  -F 'files={upload_file}

You must send the form-data, including the file to be requested CDR processing. Among the request items, svr_ip must contain the server information to be notified of the CDR processing result so that the processing result can be normally received.
[ Response ]
The response to the CDR request is shown below.
Responses to CDR request

{

“msg”:”{msg}”,

“job_id”:”{job_id}”,

“code”:{code}

}

In the case of Job_id, it is the unique id of the current CDR work in progress and is used in the CDR completed file download method as described below.
CDR Processing Completion

When the CDR Processing is complete, it passes the CDR completion information and the file to the svr_ip server in the request parameter as form-data. The CDR completion information is added by adding the result information to the existing CDR request parameters.

When the CDR file is completed, it is included in the form-data with the name "files" along with the CDR completion information.

If the CDR fails, the file is not transferred and only the failure information is transmitted.

CDR completion information

{

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"SVR_IP":"{svr_ip}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}",

 

“SAN_CODE”:”<code>”,

“SAN_MSG”:”<msg>”,

“LOG_REASON”:”<log_reason>”,

“LOG_REASON_MSG”:”<log_msg>

}

SHIELDEX LogReason 
Document Sanitization (CDR) complete check method (ver.3)
CDR Request
You can easily make document CDR requests using form-data trasnfer.
/v3/Sanitize
[ Request ]
POST
http://{SHIELDEX_address}:8087/SDFileProxy/v3/Sanitize
CDR Request Parameters

{

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}

HTTP

POST /SDFileProxy/v3/Sanitize HTTP/1.1

Host: {SHIELDEX_address}:8087

Content-Type: multipart/form-data;

Content-Disposition: form-data; name="json"

{

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}

Content-Disposition: form-data; name="files";

filename=”{upload_file}

cURL

curl -X POST \

http://{SHIELDEX_address}:8087/SDFileProxy/v3/Sanitize \

  -H 'content-type: multipart/form-data;

  -F 'json={

"USER_ID":"{user_id}",

"USER_NAME":"{user_name}",

"USER_DEPARTMENT":"{user_department}",

"USER_DUTYNAME":"{user_dutyname}",

"FI_PATH":"{file_path}",

"FI_FILENAME":"{file_name}"

}' \

  -F 'files={upload_file}

You will need to send it as form-data, including the file to CDR. The basic request parameters are the same, and do not need a web server to receive the CDR completion information and do not include web server information.
[ Response ]
The response to the CDR request is shown below.
Responses to CDR request

{

“msg”:”{msg}”,

“job_id”:”{job_id}”,

“code”:{code}

}

For Job_id, it is used as a unique key value for the current CDR request. It is very important to check whether the CDR will be terminated in the future, or to use the completed file for the requesting parameter.
Check CDR progress status
This version requires a continuous acknowledgment on the client side because the client does not notify the client when the CDR is complete. Uses the job id that is passed in the response information in the CDR request.
/v3/Status
[ Request ]
​GET
http://{SHIELDEX_address}:8087/SDFileProxy/v3/Status
CDR progress status confirmation request parameter

{

"job_id”:”{job_id}

}

HTTP

GET /SDFileProxy/v3/Status/ HTTP/1.1

Host: {SHIELDEX_address}:8087

cache-control: no-cache

{"job_id":"{job_id}"}

cURL

curl -X GET \

  http://{SHIELDEX_address}:8087/SDFileProxy/v3/Status/ \

-d '{"job_id":"{job_id}"}'

Pass the job id value that was received as in response of CDR request to confirm the CDR progress.
[ Response ]
The response to the CDR progress status confirmation request is shown below.
CDR Progress Status Request Response

{

“job_id”:”{job_id}”,

“status”:<status>,

“LogReason”:”<log_reason>

}

Even if the CDR processing is at completion stage, if the LogReason value is included the failure value of the LogReason document, the CDR processing has been failed. The status value is the result of the CDR progress status, so for the CDR processing success or failure results, please refer to the LogReason document.

SHIELDEX LogReason 
Request of downloading CDR process completed file
When the CDR processing is in completed stage, CDR completed file can be requested if the LogReason value is contained the success value of the LogReason document. Other than the above conditions, a 404 NOT_FOUND error will be delivered.
/v3/Download
[ Request ]
​GET
http://{SHIELDEX_address}:8087/SDFileProxy/v3/Download
Parameters for CDR completed file downloading request

{

"job_id”:”{job_id}

}

HTTP

GET /SDFileProxy/v3/Status/ HTTP/1.1

Host: {SHIELDEX_address}:8087

cache-control: no-cache

{"job_id":"{job_id}"}

cURL

curl -X GET \

  http://{SHIELDEX_address}:8087/SDFileProxy/v3/Download/ \

-d '{"job_id":"{job_id}"}'

In order to download a file that has been processed by CDR, you have to pass the value of job_id that was received as in response of CDR processing request.
[ Response ]
The response to a CDR completed file request is shown below.
There is no response information for the request, and the results of the CDR request can be checked through the CDR progress status request.