Scan file with API

You can find the API reference guide: OPSWAT Filescan API Reference v1API. For the following examples we used Postman which is an API platform for building and using APIs.

Using the default settings

Step #1 - Start a new request and select "POST"

Step #2 - Paste the Filescan URL to the "Enter request URL" field: https://www.filescan.io/api/scan/file

Step #3 - Upload the file and set parameters

Under Body tab select form-data.

Add a "file" key and change the type to "File".

Under the value filed select the target file.

Give some additional parameters if you want.

Step #4 - Send the request with "Send" button

Step #5 - Copy the "flow_id"

If your request was success, you will get a similar answer:

JSON
Copy

Copy the "flow_id" which is neccessary to polling the scan result.

Step #6 - Get the result

Open a new request page and select the "GET" method (it's the default).

For the URL paste [__https://www.filescan.io/api/scan/_63f633075dc36d90676259c6/report_](https://www.filescan.io/api/scan/63f633075dc36d90676259c6/report).

Change the id beween scan/ and /report to your flow_id!

Click on Send button.

If the scan has not finished yet, you should get a similar result:

JSON
Copy

The overallState field in the reports field tells you whether the scan has been completed or not. Wait some seconds and try to get the answer again by clicking the "Send" button. Repeat it until you get "success" state.

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard