Updated on 2025-08-21 GMT+08:00

Querying Tags

Function

This API is used to query the tag list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/code/tags

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

scm_type

Yes

String

Definition

Code source type.

Constraints

N/A.

Range

codehub, repo, or github.

Default Value

N/A.

repo_id

No

String

Definition

Code repository ID. It is mandatory when CodeArts Repo (codehub) is used as the code source.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

search

No

String

Definition

Filter criteria.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

page_no

No

Integer

Definition

The index of the page to start the query from.

Constraints

The value is a positive integer.

Range

The value of page_no is at least 1.

page_size

No

Integer

Definition

Number of items displayed on each page.

Constraints

The value is a positive integer.

Range

The value of page_size is no more than 100.

Request Parameters

Table 2 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 is obtained by calling the IAM API. For details, see Obtaining 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 3 Response body parameters

Parameter

Type

Description

result

Object

Definition

Data returned after the API is successfully called.

Range

N/A.

status

String

Definition

Returned status information.

Range

success: The API call is successful.

fail: The API call failed.

Table 4 result

Parameter

Type

Description

total

String

Definition

Total number of tags found.

Range

N/A.

tag_list

Array of tag_list objects

Definition

A collection of tags.

Range

N/A.

Table 5 tag_list

Parameter

Type

Description

name

String

Definition

Tag name.

Range

N/A.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET https://{endpoint}/v1/code/tags?repo_id=2111668884&search=&scm_type=codehub&page_no=1

Example Responses

Status code: 200

OK

{
  "result" : {
    "total" : 2,
    "tag_list" : [ {
      "name" : 1
    } ]
  },
  "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.