GetChangeRequestLabels - Get labels of a merge request

Updated at:

Use OpenAPI to retrieve the labels of a merge request.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Get a personal access token.
  • Obtain the organization ID: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Code Management

Merge request

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/changeRequests/{localId}/labels

Region edition

GET https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/changeRequests/{localId}/labels

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

Repository ID or URL-encoded full path.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

localId

integer

path

Yes

Local ID indicating the sequence number of the merge request in the repository.

42

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/changeRequests/42/labels' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/changeRequests/42/labels' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

color

string

Label color in hexadecimal format. Valid values: #006AD4, #2FA6A4, #6190AC, #4B81D0, #4D5DBB, #A16AD7, #3BA630, #95B44F, #AA945F, #B36A53, #FD842F, #EF433B.

#006AD4

description

string

Label description.

Indicates an error in the code

id

string

Label ID.

68c1bd9b8515477fa86fac5exxxxx941

name

string

Label name.

Bug

Response example

[
    {
        "color": "#006AD4",
        "description": "Indicates an error in the code",
        "id": "68c1bd9b8515477fa86fac5exxxxx941",
        "name": "Bug"
    }
]

Error codes

For more information about API-related error codes, see the Error Code Center.