How can I export complete archive scan results from MetaDefender Core using the REST API (session_id + extraction APIs)?

This article applies to all MetaDefender Core V5 releases deployed on Windows systems.

Why this is needed

When scanning archives, the Core UI export may not include all archive-child details or the full set of extraction issues customers want to review. In those cases, you can authenticate via the REST API, then retrieve either (a) the top 100 extraction errors or (b) the full archive report including all extracted child files.

The examples below use PowerShell, Postman, and Linux curl, but none of these tools is mandatory. You can use any REST client that can send JSON requests and custom HTTP headers.

Prerequisites

  • MetaDefender Core base URL (for example http(s)://<core-host>:<core-port>)
  • A local/LDAP/AD user that can log in via API (username + password)
  • The data_id of the parent archive scan you want to report on (from scan history / prior submission).

Login to in and obtain the session_id

What you get from Login

POST /login returns a JSON response containing session_id (and oms-csrf-token). The session_id can be used as the apikey header for protected API calls.

PowerShell

  1. Set your Core URL and credentials:
Copy
  1. Call POST /login and capture session_id:
Copy

Postman

  1. Create (or choose) an environment and add variables:
  • baseUrl = http://<core-host>:<core-port>
  • user = your username
  • password = your password
  1. Create a request:
  • Method: POST
  • URL: {{baseUrl}}/login
  • Headers: Content-Type: application/json
  • Body (raw / JSON):
Copy
  1. In Tests, store the returned session:
Copy

Linux curl tool

  1. Set your Core URL and credentials:
Copy
  1. Call POST /login:
Copy
  1. Copy the returned session_id value and store it in a shell variable:
Copy

Fetch top 100 extraction errors inside an archive

This uses: GET /file/{data_id}/extraction-errors (described as “Fetch top 100 of extraction errors inside an archive”).

PowerShell

  1. Set the target archive data_id:
Copy
  1. Call the endpoint with the apikey header:
Copy

Postman

  1. Add an environment variable:
  • data_id = <PARENT_ARCHIVE_DATA_ID>
  1. Create a request:
  • Method: GET
  • URL: {{baseUrl}}/file/{{data_id}}/extraction-errors
  • Headers: apikey: {{session_id}}
  1. Send → the response returns the extraction error list (top 100 per the endpoint description).

Linux curl tool

  1. Set the target archive data_id:
Copy
  1. Call the endpoint:
Copy

Fetch the full archive report including all extracted child files

This uses: GET /archive/{data_id} (described as “Fetch analysis reports containing all files in archive”).

PowerShell

  1. Set the target archive data_id:
Copy
  1. Call the endpoint with the apikey header:
Copy

Postman

  • Method: GET
  • URL: {{baseUrl}}/archive/{{data_id}}
  • Headers: apikey: {{session_id}}

Send → the response returns the archive-level report including all files extracted/analyzed under that archive scan.

Linux curl tool

  1. Set the target archive data_id:
Copy
  1. Call the endpoint with the apikey header:
Copy

Notes and common pitfalls

  • If you get an HTTP error code 403 (Forbidden) / 401 (Unauthorized), re-check that you are passing apikey: <session_id> (the session_id from /login is used as apikey).
  • If you get an HTTP error code 404 (Not found), confirm the data_id is correct and still retained by your Core retention policy (older scan artifacts may have been purged).

If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard