Updated on 2026-01-27 GMT+08:00

Obtaining the List of Changed Files (Deprecated)

Function

This API is used to obtain the list of changed files.

This API has been deprecated. Use the API described in Obtaining the File Change Tree of a Merge Request.

URI

GET /v2/repositories/{repository_id}/merge-requests/{merge_request_iid}/changes-trees

Table 1 Query parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

String

Explanation

Repository short ID.

Constraints

Mandatory

Range

0–2147483647

Default value

None

merge_request_iid

No

Integer

Explanation

Short ID of the merge request.

Constraints

Mandatory

Range

0–2147483647

Default value

None

view

No

String

Explanation

Short ID of the merge request.

Constraints

None.

Range

simple

Default value

None

commit_id

No

String

Explanation

Commit ID

Constraints

None.

Range

None.

Default value

None

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation

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

Constraints

Mandatory

Range

1–100,000 characters.

Default value

None.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Object Error

Response error.

result

MergeChangesTreesDto object

Explanation

Response result.

status

String

Explanation

Response status of the API.

Range

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Response error parameters

Parameter

Type

Description

code

String

Explanation

Error code returned when the API fails to be called.

Range

  • CH.10000. The system is busy. Try again later.

message

String

Explanation

Error message returned when the API fails to be called.

Range

  • The system is busy. Try again later.
Table 5 MergeChangesTreesDto

Parameter

Type

Description

tree

MergeChangesTrees objects

Explanation

File tree.

Table 6 MergeChangesTrees

Parameter

Type

Description

title

String

Explanation

Segment path.

level

Integer

Explanation

Path level.

file_path

String

Explanation

Full path of the current level.

file_type

String

Explanation

File type

Example Requests

GET https://{endpoint}/v2/repositories/{repository_id}/merge-requests/{merge_request_iid}/changes-trees

Example Responses

Status code: 200

OK
{
    "result": {
        "tree": [{
            "title": "qwdasasdfasd",
            "level": 1,
            "file_path": "qwdasasdfasd",
            "file_type": "file"
        }]
    },
    "status": "success"
}

Status Code

Status Code

Description

200

OK

Error Codes

See Error Codes.