# File Upload Scans

Step 1. Auth Token Registration Description: The first step is to register with your auth token to generate an UUID.

{% tabs %}
{% tab title="Request" %}

```json
{
    "action": "message",
    "payload": {
        "type": "auth_token_register",
        "body": {
            "auth_token": "{Your_Auth_Token}"
        }
    }
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "type": "auth_token_register",
    "request_uuid": "Your_UUID",
    "payload": {
        "message": "Auth token registered."
    },
    "event_timestamp": "2024-04-19 11:37:17.854547"
}
```

{% endtab %}
{% endtabs %}

**Step 2 - Fetching a pre-signed URL**

`file_name` - Supported file name extensions `.sol` & `.zip` It is required to supply a file name to generate a pre-signed S3 URL from our end. Note this is just a file name and not an actual file upload call.

{% tabs %}
{% tab title="Request" %}

```
GET /private/api-get-presigned-url/?file_name=Your_File.zip HTTP/1.1
Host: api.solidityscan.com
Authorization: Bearer {Your token}
```

{% endtab %}

{% tab title="Response" %}

```
{
    "status": "success",
    "result": {
        "url": "S3_signed_URL"
    }
}
```

The value of `url` in response is the signed URL where the `sol` or `zip` files need to be uploaded.
{% endtab %}
{% endtabs %}

**Step 3 - Scan initiation Request**

{% tabs %}
{% tab title="Request" %}

```
{
    "action": "message",
    "payload": {
        "type": "private_project_scan_initiate",
        "body": {
            "file_urls": [
                "S3_signed_URL"
            ],
            "project_name": "TestRemix",
            "project_type": "new"
        }
    }
}
```

{% endtab %}

{% tab title="Response" %}

```
{
    "type": "scan_status",
    "request_uuid": "e58492f72f9b7d27a5c75478a2e529eb",
    "payload": {
        "scan_id": "31118a10c7fe1309",
        "scan_status": "scan_done",
        "project_id": "4c3d528a944e7b56f696c87447609a7d",
        "scan_details": {
            "link": "JSON_Response_Link"
        }
    },
    "event_timestamp": "2024-04-19 11:38:05.735806"
}
```

{% endtab %}
{% endtabs %}

The value of the `link` is the s3 link of the JSON response of the scan result data.

#### Sample Response: <a href="#sample-response" id="sample-response"></a>

{% file src="<https://4103464763-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaqKivgb07WQWzl1XsCC9%2Fuploads%2Fgit-blob-9108ee4ae6aad3bb66b8cddfc8e622d78996cffb%2Fresponse.json?alt=media>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidoc.solidityscan.com/solidityscan-security-api/getting-started/apis/solidityscan-private-api/websocket-api/file-upload-scans.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
