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 limits

You can call this operation up to 50 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Request parameters

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

The list of IDs of asynchronous moderation tasks that you want to query. The array can contain up to 100 elements.

After you submit a moderation task, you can obtain the ID of the task from the response.

Returned data

NameTypeExampleDescription
codeInteger200

The returned HTTP status code.

For more information, see Common error codes.

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

The ID of the moderation object.

Note

If you set the dataId parameter in the moderation request, the value of the dataId request parameter 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"
}