Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining the List of Changed Files
Updated on 2025-03-28 GMT+08:00

Obtaining the List of Changed Files

Function

Obtains the list of changed files.

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 parameters

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 Response

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 code.

See Error Codes.