Help Center/ CodeArts Repo/ API Reference (Ally Region)/ APIs/ Repository/ Obtaining Files in a Branch Directory
Updated on 2026-01-08 GMT+08:00

Obtaining Files in a Branch Directory

Description

This API is used to obtain files in the branch directory.

URI

GET /v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Repository ID

branch_name

Yes

String

Branch name

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

path

No

String

File path

offset

No

Integer

Offset

limit

No

Integer

Number of records

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error

result

LogsTreeList object

Response result

status

String

Response status

Table 5 Error

Parameter

Type

Description

code

String

Error codes

message

String

Error message

Table 6 LogsTreeList

Parameter

Type

Description

trees

Array of LogsTree objects

File log tree

total

Integer

Total number of records

Table 7 LogsTree

Parameter

Type

Description

blob_id

String

Storage block ID

commit

Commit object

Commit message

file_name

String

File name

file_path

String

File path

md5

String

MD5

type

String

Storage type

Table 8 Commit

Parameter

Type

Description

author_email

String

Author email

author_name

String

Author

authored_date

String

Author commit time

committed_date

String

Commit time

committer_email

String

Committer email

committer_name

String

Committer

format

Object

File change details. The format is determined by the stat_format parameter.

id

String

SHA ID of a commit

message

String

Commit message

parent_ids

Array of strings

Parent commit ID

Request Examples

GET https://{endpoint}/v1/repositories/{repository_uuid}/branch/{branch_name}/sub-files

Response Examples

Status code: 200

Request succeeded

{
  "result" : {
    "trees" : [ {
      "blob_id" : "ef69ef5dc0c53022fe52a4d02de15f73d96e055c",
      "file_name" : "csharpDemo.png",
      "file_path" : "images/csharpDemo.png",
      "md5" : "8830d25fe6b4e2cd14d75ddb5cae73a7",
      "type" : "blob",
      "commit" : {
        "id" : "1cfd6d81fff948828c7f59bda74c0ef80e53def0",
        "message" : "init",
        "parent_ids" : [ ],
        "author_name" : "repo",
        "author_email" : "repo@test.com",
        "committed_date" : "2019-11-13 11:29:26",
        "committer_name" : "repo",
        "committer_email" : "repo@test.com"
      }
    } ],
    "total" : 5
  },
  "status" : "success"
}

Status Codes

Status Codes

Description

200

Request succeeded

Error codes

See Error Codes.