Help Center/ CodeArts Check/ API Reference/ APIs/ Task Management/ Querying Historical Scan Results
Updated on 2024-03-15 GMT+08:00

Querying Historical Scan Results

Function

Provides statistics on the number of issues scanned each time.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/tasks/{task_id}/checkrecord

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

task_id

Yes

String

Task ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Pagination index, offset

Minimum: 0

Default: 0

limit

No

Integer

Number of records displayed on each page. A maximum of 1000 records can be displayed on each page.

Minimum: 1

Maximum: 1000

Default: 10

start_time

No

String

Start time for filtering tasks. Tasks are filtered based on the start time.

end_time

No

String

End time of the filtering. The filtering is performed based on the end time of the task check.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 100000

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

Array of CheckRecordDataInfo objects

Historical data

total

Integer

Total

Table 5 CheckRecordDataInfo

Parameter

Type

Description

check_time

String

Schedule

check_end_time

String

Checks the task execution end time.

issue_counts

CheckRecordIssueCountsInfo object

Severity

Table 6 CheckRecordIssueCountsInfo

Parameter

Type

Description

critical

Integer

Critical Issues

serious

Integer

Major

normal

Integer

Common Problems

prompt

Integer

Suggestion

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Example Requests

GET https://{endpoint}/v2/{project_id}/tasks/{task_id}/checkrecord

Example Responses

Status code: 200

Request succeeded!

{
  "total" : 100,
  "data" : [ {
    "check_time" : "2020-02-20 11:37:46",
    "check_end_time" : "2020-02-20 11:47:46",
    "issue_counts" : {
      "critical" : 0,
      "serious" : 1,
      "normal" : 2,
      "prompt" : 3
    }
  }, {
    "check_time" : "2020-02-20 11:37:46",
    "check_end_time" : "2020-02-20 11:47:46",
    "issue_counts" : {
      "critical" : 0,
      "serious" : 1,
      "normal" : 2,
      "prompt" : 3
    }
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "CC.00000000",
  "error_msg" : "The network is busy. Please try again later."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "The authentication information has expired."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.