ListProjectLabels

Updated at:

Retrieves a list of repository labels. This operation supports pagination, sorting, and keyword search.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v4/projects/labels HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. You can obtain the organization ID from the URL of your organization on Alibaba Cloud DevOps. The URL is in the format https://devops.aliyun.com/organization/{organizationId}.

5ebbc0228123212b59xxxxx

accessToken

string

No

The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or STS temporary authorization for authentication.

f0b1e61db5961df5975a93f9129d2513

repositoryIdentity

string

Yes

The ID or full path of the repository.

2835387 或 codeup/codeup-demo

search

string

No

A keyword used to filter labels by name.

TEST

page

integer

No

The page number of the results to return. Starts from 1. Default: 1.

1

pageSize

integer

No

The number of results per page. The value must be between 1 and 100. Default: 20.

20

orderBy

string

No

The field to sort the results by. Valid values:

  • label_name: Sorts by label name (default).

label_name

sort

string

No

The sort order. Default: desc. Valid values:

  • desc: Descending

  • asc: Ascending

desc

withCounts

boolean

No

Specifies whether to return the count of associated merge requests. Default: false.

false

Response elements

Element

Type

Description

Example

object

The response body.

requestId

string

The ID of the request.

ASSDS-ASSASX-XSAXSA-XSAXSAXS

success

boolean

Indicates whether the request succeeded.

true

errorCode

string

The error code if the request fails.

Openapi.RequestError

errorMessage

string

The error message if the request fails.

""

total

integer

The total count of matching labels.

30

result

array<object>

The list of returned labels.

object

A label object.

id

string

The unique ID of the label.

f2bf0e0b4ce34a348b2d971c69a1d11f

name

string

The name of the label.

优化

color

string

The hexadecimal color code of the label.

#A16AD7

description

string

The description of the label.

已有内容的优化或重构

openMergeRequestsCount

integer

The number of open merge requests associated with this label.

1

Examples

Success response

JSON format

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "success": true,
  "errorCode": "Openapi.RequestError",
  "errorMessage": "\"\"",
  "total": 30,
  "result": [
    {
      "id": "f2bf0e0b4ce34a348b2d971c69a1d11f",
      "name": "优化",
      "color": "#A16AD7",
      "description": "已有内容的优化或重构",
      "openMergeRequestsCount": 1
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.