Query file scan results

Updated at:

After you submit a file scan task, call the /green/file/results operation to query the scan results.

Usage notes

Use the /green/file/results API operation to query file scan results.

The client periodically polls for scan results. We recommend a polling interval of 30 seconds. The maximum interval is 1 hour. If the polling interval exceeds 1 hour, the results are lost.

QPS limit

The queries per second (QPS) limit for this API is 50 per user. Exceeding this limit triggers throttling, which can impact your business. Plan your calls accordingly.

Request parameters

NameTypeRequiredExampleDescription
bodyStringArrayYes["file_t_6Tu1kOFV4Lw4g7dWMH4Yp1-1oB8Ci","file_image_t_5pvbNDryAe06MsUTytddIY-1oC1Db"]

A list of taskId values for the detection tasks you want to query. The array can contain up to 100 elements.

You can obtain the taskId from the response after you submit a detection task.

Returned data

NameTypeExampleDescription
codeInteger200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

taskIdStringfile_t_6Tu1kOFV4Lw4g7dWMH4Yp1-1oB8CiThe ID of the scan task.
dataIdStringtest6WVsaaxBAkY5wWn4N6kCU$-1oB8Ci

The data ID of the detection object.

Note

If dataId was passed in the detection request, the same dataId is returned here.

textResultsJSONArrayThe results of the text scan that is performed when textScenes is specified. For more information about the result structure, see the response parameters in Text moderation.
imageResultsJSONArrayThe results of the image scan that is performed when imageScenes is specified. For more information about the structure, see the response parameters in Query image moderation results.
urlStringhttps://aliyundoc.com/test/file/test3.docx?Expires=1521800184&OSSAccessKeyId=xxxxxxxxxxx&Signature=xxxxxxxxxxxxThe URL of the source file that was scanned.
msgStringOKThe response returned for the request.

Examples

Request example
http(s)://[Endpoint]/green/file/results
&<Common request parameters>
[
    "file_t_6Tu1kOFV4Lw4g7dWMH4Yp1-1oB8Ci",
    "file_image_t_5pvbNDryAe06MsUTytddIY-1oC1Db"
]
Successful response example
{
    "code": 200,
    "data": [
        {
            "dataId": "test6WVsaaxBAkY5wWn4N6kCU$-1oB8Ci",
            "taskId": "file_t_6Tu1kOFV4Lw4g7dWMH4Yp1-1oB8Ci",
            "textResults": [
                {
                    "code": 200,
                    "content": "test",
                    "msg": "OK",
                    "results": [
                        {
                            "label": "normal",
                            "rate": 99.91,
                            "scene": "antispam",
                            "suggestion": "pass"
                        }
                    ],
                    "taskId": "file_text_t_5R3Pmeqkbl94kSNl5uvTKN-1oB8Cl"
                }
            ],
            "imageResults": [
                {
                    "msg": "OK",
                    "code": 200,
                    "results": [
                        {
                            "rate": 99.91,
                            "suggestion": "pass",
                            "label": "normal",
                            "scene": "terrorism"
                        },
                        {
                            "rate": 99.91,
                            "suggestion": "pass",
                            "label": "normal",
                            "scene": "porn"
                        }
                    ],
                    "taskId": "file_image_t_5pvbNDryAe06MsUTytddIY-1oC1Db",
                    "url": "http://aliyundoc.com/prod/hammal/2611c68/6_10188943_5inaGVFwoCSh3ii3pdjhAOWahE76XSySjmErLYhy_analysis_file.png?Expires=1522039397&OSSAccessKeyId=xxxxxxxx&Signature=xxxxxxxxxxxxxxxx"
                }
            ],
            "url": "https://aliyundoc.com/test/file/test3.docx?Expires=1521800184&OSSAccessKeyId=xxxxxxxxxxx&Signature=xxxxxxxxxxxx"
        }
    ],
    "msg": "OK",
    "requestId": "68C7BA1A-3F91-454A-A1B7-81CA032348F3"
}