Help Center/ CodeArts Build/ API Reference/ APIs/ CodeArts Build (Out-of-date)/ Querying the Latest Successful Build with a Specified Code Repository
Updated on 2025-12-24 GMT+08:00

Querying the Latest Successful Build with a Specified Code Repository

Function

This API is used to query the latest successful build with a specified code repository.

Calling Method

For details, see Calling APIs.

URI

GET /v3/jobs/{project_id}/last-history

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

CodeArts project ID. For details, seeObtaining a CodeArts Project ID.

Constraints

N/A.

Range

Use a 32-character string containing a mix of digits and letters.

Default Value

N/A.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

repository_name

Yes

String

Definition

Code repository name.

Constraints

N/A.

Range

The value contains a maximum of 256 characters.

Default Value

N/A.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. (The value of the X-Subject-Token response header is the user token.) It can be obtained by calling the IAM service API. For details, seeObtaining an IAM User Token.

Constraints

Global tenant tokens are not supported. Use a region-level token whose scope is project.

Range

N/A.

Default Value

N/A.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

record_id

String

Definition

Build record ID. It is a unique key.

Range

N/A.

job_id

String

Definition

Build task ID.

Range

N/A.

job_name

String

Definition

Build task name.

Range

N/A.

build_number

Integer

Definition

Build number.

Range

N/A.

start_time

String

Definition

Build start time.

Range

N/A.

end_time

String

Definition

Build end time.

Range

N/A.

result

String

Definition

Build result.

Range

N/A.

commit_id

String

Definition

Commit ID.

Range

N/A.

Example Requests

GET https://{endpoint}/v3/jobs/6ecbc5bac7c8442fb3d2563d53c13582/last-history?repository_name=maven-demo

Example Responses

Status code: 200

OK

{
  "record_id" : "20210722.16",
  "job_id" : "37be03edd1da430c8079504d546cc499",
  "job_name" : "test_job_01",
  "build_number" : 16,
  "start_time" : "2021-07-22T16:26:52+08:00",
  "end_time" : "2021-07-22T16:27:15+08:00",
  "result" : "SUCCESS",
  "commit_id" : "e311c54476e0e536f0ecdeeba8dc184216fa2057"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.