ListLabels - Get a list of labels

Updated at:

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.
  • Get organizationId: 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

Project Collaboration

Label

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/{id}/labels

Region edition

GET https://{domain}/oapi/v1/projex/projects/{id}/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

id

string

path

Yes

Unique project identifier.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

page

integer

query

No

Page number.

perPage

integer

query

No

Number of items per page.

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/{id}/labels?page={page}&perPage={perPage}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/projects/{id}/labels?page={page}&perPage={perPage}' \
  -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.

test

id

string

Label ID.

id-xxx

name

string

Label name.

test

Response example

[
    {
        "color": "test",
        "id": "id-xxx",
        "name": "test"
    }
]

Response headers

Parameter

Description

Example value

x-next-page

Next page number.

x-page

Current page number.

x-per-page

Number of items per page.

x-prev-page

Previous page number.

x-total

Total number of items.

x-total-pages

Total number of pages.

Error codes

For error codes, see Error Code Center.