5.2.4 Fetch processing results for a file

Title

Fetch processing results for a file

URL Path

/api/file/{id}

Method

GET

Summary

File processing is done asynchronously and each analysis request is tracked by a file ID. Because processing a file is a potentially time-consuming operation, scheduling a file for processing and retrieving the results needs to be done using two separate API calls.

This request needs to be made multiple times until the analysis is complete. Analysis completion can be tracked using the processingState and the progress values from the response.

HTTP Headers

Authorization

required

Bearer <JWT>

Request URL parameters

id

required

String that represents the ID associated with the file

Request errors

400 Bad Request

Invalid HTTP request

401 Unauthorized

Unauthorized HTTP request

404 Not Found

The requested resource could not be found

500 Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"id": "5e91c094efe27b0006489533",
"storageType": 0,
"storageName": "S3 Storage",
"scanId": "5e91c093efe27b0006489532",
"fileOwner": {
"userId": "9190F2CE-2AC4-4CD0-83DC-DB01D35759A9"
},
"name": "1K.mp4",
"path": "1K.mp4",
"hash": "ede3d3b685b4e137ba4cb2521329a75e",
"progress": {
"upload": 100,
"scan": 100
},
"size": 1000,
"scanResult": {
"scanResults": {
"scanDetails": [
{
"engineName": "Ahnlab",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T00:00:00.000Z",
"scanTime": 2,
"engId": "ahnlab_1_linux"
},
{
"engineName": "Avira",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T00:00:00.000Z",
"scanTime": 3,
"engId": "avira_1_linux"
},
{
"engineName": "Bitdefender",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T07:47:59.000Z",
"scanTime": 2,
"engId": "bitdefender_1_linux"
},
{
"engineName": "Clamav",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-10T11:52:37.000Z",
"scanTime": 16,
"engId": "clamav_1_linux"
},
{
"engineName": "Cyren",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T08:25:00.000Z",
"scanTime": 20,
"engId": "cyren_1_linux"
},
{
"engineName": "ESET",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T00:00:00.000Z",
"scanTime": 1,
"engId": "eset_1_linux"
},
{
"engineName": "Ikarus",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T07:50:16.000Z",
"scanTime": 0,
"engId": "ikarus_1_linux"
},
{
"engineName": "K7",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-04T00:00:00.000Z",
"scanTime": 0,
"engId": "k7_1_linux"
},
{
"engineName": "McAfee",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-11T03:09:00.000Z",
"scanTime": 31,
"engId": "mcafee_1_linux"
},
{
"engineName": "QuickHeal",
"threatFound": "",
"scanResultI": 0,
"defTime": "2020-04-10T03:00:00.000Z",
"scanTime": 24,
"engId": "quickheal_1_linux"
}
],
"dataId": "5b97b6cbe7d348a9b1c876abbac7f45a",
"scanAllResultI": 0,
"scanAllResultA": "No Threat Detected",
"startTime": "2020-04-11T13:05:25.895Z",
"totalTime": 142,
"totalAvs": 11,
"progressPercentage": 100
},
"fileInfo": {
"fileSize": 1000,
"uploadTimestamp": "2020-04-11T13:05:25.878Z",
"md5": "ede3d3b685b4e137ba4cb2521329a75e",
"sha1": "c577f7a37657053275f3e3ecc06ec22e6b909366",
"sha256": "541b3e9daa09b20bf85fa273e5cbd3e80185aa4ec298e765db87742b70138a53",
"fileTypeDescription": "data",
"displayName": "1K.mp4"
},
"processInfo": {
"postProcessing": {
"actionsRan": "",
"actionsFailed": "",
"convertedTo": "",
"copyMoveDestination": "",
"convertedDestination": ""
},
"progressPercentage": 100,
"userAgent": "mdss",
"profile": "MetaDefender for Secure Storage",
"result": "Allowed",
"blockedReason": "",
"fileTypeSkippedScan": false,
"processingTime": 142,
"queueTime": 17
},
"dataId": "5b97b6cbe7d348a9b1c876abbac7f45a",
"dlpInfo": {
"verdict": 4
},
"vulnerabilityInfo": {}
},
"processingState": 3,
"created": "2020-04-11T13:05:24.885Z",
"uploadTimeSpanMs": 995,
"uploadCompleted": "2020-04-11T13:05:25.88Z",
"engineVersions": []
}

Description of response

  • id: ID of the requested file

  • storageType: type of the storage

  • storageName: name of the storage

  • scanId: ID of the scan

  • scanName: name of the scan

  • name: file name

  • path: file path

  • size: file size

  • hash: storage specific hash (for S3 and OneDrive it is the ETag, for Box it is SHA1)

  • progress: progress information about upload and scanning

  • processingState: file processing state

    • 0 - In Progress

    • 1 - Failed

    • 2 - Available

  • exceptionDetails: a field describing the issue in case of a processing failure

  • created: date and time when request was made

  • uploadTimeSpanMs: time needed to upload the file (the difference between created and uploadCompleted in milliseconds)

  • uploadCompleted: date and time when the upload was completed

  • scanResult: results of the scan returned by MetaDefender Core

    • extractedFiles: information about extracted files in case of an archive file

    • dataId: MetaDefender Core generated ID of the requested file

    • fileInfo: basic information of the scanned file

    • processInfo: process information

      • postProcessing: Contains information about result of data sanitization

        • actionsRan: "Sanitized" or empty string and the names of Post Actions that were also run.
          The separator is "|" (pipe). (e.g.: actions_ran: "PAscript" or actions_ran: "Sanitized | PAscript")

        • actionsFailed: "Sanitization Failed" or empty string and the names of failed Post Actions.
          The separator is "|" (pipe). (e.g.: actions_failed: "PAscript failed" or actions_failed: "Sanitization Failed | PAscript failed" )

        • convertedTo: contains target type name of sanitization

        • copyMoveDestination: this field is obsolete, it should not be used

        • convertedDestination: contains the name of the sanitized file

      • processingTime: total time elapsed during processing file on the node in milliseconds

      • progressPercentage: percentage of processing completed

      • queueTime: total time elapsed during file waits in the queue in milliseconds

      • userAgent: who called this API

      • profile: the name of the rule used

      • result: the final result of processing the file (Allowed / Blocked / Processing)

      • blockedReason: gives the reason if the file is

      • blockedProcessInfo: process information

      • fileTypeSkippedScan: indicates if the input file's detected type was configured to skip scanning

    • scanResults: results of the scan

      • scanDetails: scan results for each antivirus engine. The key is the name of the antivirus engine and the value is the result of the antivirus engine

        • defTime: the database definition time for this engine

        • engId: the unique identification string for the engine

        • scanResultI: numeric code of engine scan result

        • scanTime: time elapsed during scan with the engine in milliseconds

        • waitTime: time elapsed between sending file to node and receiving the result from the engine in milliseconds

        • threatFound: name of the scan result

      • dataId: MetaDefender Core generated ID of the requested file

      • scanAllResultI: the overall scan result in number code

        • individual scan engine results will be consolidated according to the following priority:

          1. Threat found

          2. Object is suspicious

          3. Object is encrypted / too deep (archive only) / too big (archive only) / containing too many files (archive only) / extraction timeout exceeded (archive only)

          4. Filetype mismatch

          5. No threat detected

          6. Object was not scanned

          7. Failed to scan the object

      • scanAllResultA: the overall scan result in string

      • startTime: start time of scan as recorded by MetaDefender Core

      • totalAvs: number of used antivirus engines

      • totalTime: total time elapsed during scan in milliseconds as recorded by MetaDefender Core

      • progressPercentage: percentage of progress; if it is 100, then the scan is completed

  • vulnerabilityInfo: see 8.1.6. Vulnerability Info In Processing Result

  • dlpInfo: information on matched sensitive data

    • hits: detailed results that contains:

      • type of matched rule: ccn (credit card number), ssn (social security number), regex_<number> (regular expression with a number in order to differentiate the RegEx rules if there are more)

        • display_name: Credit Card Number, Social Security Number, or in case of RegEx, the name of the rule that has been given by the user

        • hits: the hits for that type

          • before: the context before the matched data

          • after: the context after the matched data

          • certainty: text version of "certainty_score", possible values:

            • Very Low

            • Low

            • Medium

            • High

            • Very High

          • certainty_score: is defined by the relevance of the given hit in its context. It is calculated based on multiple factors such as the number of digits, possible values: [0-100]

          • hit: the matched data

          • severity (NOTE: this field is deprecated): can be 0 (detected) or 1 (suspicious)

    • severity (NOTE: this field is deprecated): represents the severity of the data loss, possible values:

      • 0 - Certainly is data loss

      • 1 - Might be data loss

    • verdict: the overall result for the scanned file. It can be:

      • 0 - clean

      • 1 - found matched data

      • 2 - suspicious

      • 3 - failed

      • 4 - not scanned (e.g. not supported file type)