CreateCommitComment - 给单个提交添加评论

通过 OpenAPI 给单个提交添加评论。

适用版本

标准版

服务接入点与授权信息

  • 获取服务接入点,替换 API 请求语法中的 <domain> :服务接入点(domain)

  • 获取个人访问令牌,具体操作,请参见获取个人访问令牌

  • 获取organizationId,请前往组织管理后台基本信息页面获取组织 ID 。

    产品

    资源

    所需权限

    代码管理

    提交

    读写

请求语法

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/commits/{sha}/comments

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

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

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

组织 ID。

60de7a6852743a5162b5f957

repositoryId

string

path

代码库 ID 或者 URL-Encoder 编码的全路径。

2813489或者60de7a6852743a5162b5f957%2FDemoRepo

sha

string

path

提交的 SHA 值。

2b4f8fc38bdf464359c3a05334654fa27e15a704

-

object

body

commit 的评论。

content

string

body

commit 的评论内容。

comment content

请求示例

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60de7a6852743a5162b5f957/repositories/2813489或者60de7a6852743a5162b5f957%2FDemoRepo/commits/2b4f8fc38bdf464359c3a05334654fa27e15a704/comments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "content": "comment content"
    }'

返回参数

错误码

访问错误码中心查看 API 相关错误码。