Help Center/ CodeArts Build/ API Reference/ APIs/ LogManager/ Obtaining Build Logs After Task Execution
Updated on 2025-08-21 GMT+08:00

Obtaining Build Logs After Task Execution

Function

This API is used to obtain build logs after task execution.

Calling Method

For details, see Calling APIs.

URI

GET /v1/log/stage/page

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Definition

Build task ID.

It includes digits and letters. To obtain this ID, open the page for editing the build task in your browser, and copy the 32-character string at the end of the URL.

Constraints

N/A.

Range

The 32-character string sits at the end of the URL and includes digits and letters.

Default Value

N/A.

build_no

Yes

Integer

Definition

The build number tracks each run of the build task. This parameter starts at 1, indicating the first build. It increments by 1 for every subsequent run.

Constraints

The value is a positive integer.

Range

Use only numbers that are 1 or greater.

Default Value

1

start_offset

Yes

Integer

Definition

Where the query begins.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

end_offset

Yes

Integer

Definition

Where the query ends.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

sort

No

String

Definition

Sorting order.

Constraints

N/A.

Range

AES or DESC.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

result

result object

Result.

error

String

Returned error message.

status

String

Returned status information.

Table 3 result

Parameter

Type

Description

has_more

Boolean

Definition

Whether there are remaining logs.

Constraints

N/A.

Range

true or false

Default Value

N/A.

start_offset

String

Definition

The offset used to specify a starting point in the result set returned by a query.

Constraints

N/A.

Range

The value consists of numbers.

Default Value

N/A.

end_offset

String

Definition

The offset used to specify an end point in the result set returned by a query.

Constraints

N/A.

Range

The value consists of numbers.

Default Value

N/A.

log

String

Definition

Returned log content. Request again if it is empty.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

location

String

Definition

Log source.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET https://{endpoint}/v1/log/stage/page

Example Responses

Status code: 200

OK

{
  "result" : {
    "start_offset" : 0,
    "end_offset" : 24351,
    "log" : "[2025/06/26 14:23:32.169 GMT+08:00] [INFO] [Code checkout:external_pre_checkout] : This action starts.\n[2025/06/26 14:23:32.172 GMT+08:00]...",
    "has_more" : false,
    "location" : "jenkins"
  },
  "error" : null,
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.