ListProjectLabels
Retrieves a list of repository labels. This operation supports pagination, sorting, and keyword search.
Try it now
Test
RAM authorization
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 |
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 |
| sort |
string |
No |
The sort order. Default:
|
desc |
| withCounts |
boolean |
No |
Specifies whether to return the count of associated merge requests. Default: |
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.