CreateCommitComment - Add a comment to a commit
Adds a comment to a specific commit by calling an OpenAPI operation.
|
Applicable editions |
Central edition, Region edition |
Endpoints and authorization information
- Get an endpoint: Replace {domain} in the API request syntax.
- Get a personal access token.
- Obtain the organization ID: This is required only for the Central edition. You can obtain the organization ID from the Basic Information page in the Organization Management console.
|
Product |
Resource |
Required permission |
|
Code Management |
Commit |
Read/Write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/commits/{sha}/comments
Region edition
POST https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/commits/{sha}/comments
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Position |
Required |
Description |
Example |
|
organizationId |
string |
path |
|
The ID of the organization. |
60de7a6852743a5162b5f957 |
|
repositoryId |
string |
path |
Yes |
The repository ID or the URL-encoded full path of the repository. |
2813489 or 60de7a6852743a5162b5f957%2FDemoRepo |
|
sha |
string |
path |
Yes |
The SHA hash of the commit. |
2b4f8fc38bdf464359c3a05334654fa27e15a704 |
| - |
object |
body |
No |
The commit comment object. |
|
| content |
string |
body |
Yes |
The content of the commit comment. |
comment content |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/codeup/organizations/60de7a6852743a5162b5f957/repositories/2813489/commits/2b4f8fc38bdf464359c3a05334654fa27e15a704/comments' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": "comment content"
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/codeup/repositories/60de7a6852743a5162b5f957%2FDemoRepo/commits/2b4f8fc38bdf464359c3a05334654fa27e15a704/comments' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": "comment content"
}'
Response parameters
None
Error codes
For a list of error codes, see Error Code Center.