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

Querying Historical Check Results

Function

This API is used to provide statistics on 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

Offset for pagination.

limit

No

Integer

Number of items displayed on each page. A maximum of 1,000 items are supported.

start_time

No

String

Start time of task. Filter tasks by start time.

end_time

No

String

End time of task. Filter tasks by end time.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

Array of CheckRecordDataInfo objects

Data history.

total

Integer

Total number.

Table 5 CheckRecordDataInfo

Parameter

Type

Description

check_time

String

Task execution start time.

check_end_time

String

Task execution end time.

issue_counts

CheckRecordIssueCountsInfo object

Severity.

Table 6 CheckRecordIssueCountsInfo

Parameter

Type

Description

critical

Integer

Critical issues.

serious

Integer

Major issues.

normal

Integer

Minor issues.

prompt

Integer

Suggestion issues.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

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" : "Network busy. Try again later."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "Authentication information expired."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.