CreateWorkitemComment - 创建工作项评论

Updated at:

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Obtain a personal access token。
  • Obtain an organization ID:Required only for the Central edition. Go to theorganization management consoleand obtain the organization ID from thebasic informationpage.

Product

Resource

Required permission

Project Collaboration

workitem comment

Read/write

Request syntax

Central edition

POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/comments

Region edition

POST https://{domain}/oapi/v1/projex/workitems/{id}/comments

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

The unique identifier of the workitem.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

-

object

body

No

content

string

body

Yes

The content of the comment.

This is a comment.

formatType

string

body

No

The content format. Valid values: RICHTEXT and MARKDOWN. Default value: RICHTEXT.

RICHTEXT

operatorId

string

body

No

The user ID of the operator. This parameter is ignored when you use a personal access token.

1963183528xxxxxx

parentId

string

body

No

The ID of the parent comment.

1112333

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "content": "Comment content",
        "formatType": "RICHTEXT",
        "operatorId": "The operator user ID. This parameter is ignored when a personal token is used.",
        "parentId": "1112333"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/workitems/{id}/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "content": "Comment content",
        "formatType": "RICHTEXT",
        "operatorId": "The operator user ID. This parameter is ignored when a personal token is used.",
        "parentId": "1112333"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

ID.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

Visit the Error Code Center to view API error codes.