Querying Historical Check Results
Function
This API is used to query the number of issues of each severity level in every scan for a task during a specified period.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/tasks/{task_id}/checkrecord
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
task_id |
Yes |
String |
Definition Task ID, returned by the API for creating a check task. Each CodeArts Check task, branch task, or incremental task generated through an API has a unique ID. Constraints N/A Range N/A Default Value N/A |
project_id |
Yes |
String |
Definition Unique 32-character UUID of a project. Obtain a UUID by calling the API forquerying projects. Constraints N/A Range 32-character project ID. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Definition Page number. It is similar to page_num. Constraints N/A Range 0–999,999 |
limit |
No |
Integer |
Definition Number of records on each page. It is similar to page_size. Constraints N/A Range 1-1,000 |
start_time |
No |
String |
Definition Check start time. Use UTC time in format "yyyy-MM-ddTHH:mm:ssZ". For example, 2020-09-25T12:05:00Z. Constraints N/A Range N/A Default Value 2000-01-01T00:00:00Z |
end_time |
No |
String |
Definition Check end time. Use UTC time in format "yyyy-MM-ddTHH:mm:ssZ". For example, 2020-09-25T12:05:00Z. Constraints N/A Range N/A Default Value Current time |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token. Obtain a token by calling the IAM API forobtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range 1–100,000 characters Default Value N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
data |
Array of CheckRecordDataInfo objects |
Definition Number of issues of each severity level during each scan. Range N/A |
total |
Integer |
Definition Total number of scans. Range N/A |
Parameter |
Type |
Description |
---|---|---|
jobId |
String |
Definition Execution ID. Leave this parameter blank for a version scan and pass a value for a quality gate scan. Range N/A |
check_time |
String |
Definition Check task start time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. Range N/A |
check_end_time |
String |
Definition Check task end time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. Range N/A |
issue_counts |
CheckRecordIssueCountsInfo object |
Definition Number of issues of each severity level. Range N/A |
Parameter |
Type |
Description |
---|---|---|
critical |
Integer |
Definition Number of critical issues. Range N/A |
serious |
Integer |
Definition Number of major issues. Range N/A |
normal |
Integer |
Definition Number of minor issues. Range N/A |
prompt |
Integer |
Definition Number of suggestions. Range N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Query all scan results of task ID 2b31ed520xxxxxxebedb6e57xxxxxxxx under project ID e04b357xxxxx5ed832xxxxxx from 2025-06-01T00:00:00Z to 2025-06-10T00:00:00Z.
GET https://{endpoint}/v2/363540xxxxxxxx5105099944xxxxxxxx/tasks/2b31ed520xxxxxxebedb6e57xxxxxxxx/checkrecord?start_time=2025-06-01T00:00:00Z&end_time=2025-06-10T00:00:00Z null
Example Responses
Status code: 200
Request succeeded!
{ "total" : 100, "data" : [ { "check_time" : "2023-11-29T05:28:41Z", "check_end_time" : "2023-11-29T05:30:38Z", "job_id" : "84xxxxxxxxxxxxxxxxxxxxxxxxxxxx6f", "issue_counts" : { "critical" : 0, "serious" : 1, "normal" : 2, "prompt" : 3 } }, { "check_time" : "2023-09-29T05:28:41Z", "check_end_time" : "2023-09-29T05:30:38Z", "job_id" : "a4xxxxxxxxxxxxxxxxxxxxxxxxxxxxb1", "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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot