> For the complete documentation index, see [llms.txt](https://rest-api.symphony.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rest-api.symphony.com/main/malware-scanner/customer-malware-scanner-apis/file-malware-scanner.md).

# File Malware Scanner

## API to be implemented by the customer.

<mark style="color:orange;">`PUT`</mark> `https://your-malware-scanner-domain.com/malware-scanner/v1/file`

Symproxy uses this API to submit the attachment for malware scanning.

Malware Scanner implementation should initiate the malware scanning of the attachment after receiving the file successfully.

:information\_source: • It is highly recommended that the API call does not enforce the malware-scanning operation synchronously. Instead, queue the request to some internal queue and return the response back, unblocking the client (Symproxy). • The service should be idempotent. There could be multiple submissions for the same file.

:construction: When invoking the `malware-scanner/v1/file` endpoint on the scanner, symproxy will wait a maximum of 10 seconds for a response from the scanner. If it does not get a response in 10 seconds, it will retry. It will try three times to invoke the `malware-scanner/v1/file` endpoint on the scanner if each previous attempt is unsuccessful.

#### Headers

| Name        | Type    | Description                                                                                                                                                                                                                                   |
| ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| X-Trace-Id  | string  | Trace ID that shall be returned back in header when updating the malware scan state for the file. This field is not required, being used for debugging purposes only.                                                                         |
| X-Ping-Scan | boolean | For diagnostic purposes only. If this header is set to true, the Malware Scanner shall not perform any scanning and just return HTTP 200 OK. This is required (mandatory) to check the connectivity between Symproxy and the Malware Scanner. |

#### Request Body

| Name                                      | Type   | Description                            |
| ----------------------------------------- | ------ | -------------------------------------- |
| content<mark style="color:red;">\*</mark> | string | Attachment body, binary string format. |

{% tabs %}
{% tab title="200: OK Result" %}

```javascript
//Successfully initiated the malware scan of the given file.
```

{% endtab %}

{% tab title="400: Bad Request Result" %}

```javascript
//Bad Request. See response body for further details.
```

{% endtab %}

{% tab title="429: Too Many Requests Result" %}

```javascript
//Too many requests. See response body for further details.
```

{% endtab %}

{% tab title="500: Internal Server Error Result" %}

```javascript
//Server error. See response body for further details.
```

{% endtab %}
{% endtabs %}
