ListRepositoryCommits
Queries the commit history of a code repository with support for scroll pagination.
Try it now
Test
RAM authorization
Request syntax
GET /repository/{repositoryId}/commits HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| repositoryId |
integer |
Yes |
The code repository ID. |
2334743 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The enterprise identifier, also known as the enterprise ID. This string can be obtained from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId]. |
60de7a6852743a5162b5f957 |
| accessToken |
string |
No |
The personal access token. This field is not required if you use an Alibaba Cloud AccessKey ID and AccessKey secret or Security Token Service (STS) temporary authorization. |
f0b1e61db5961df5975a93f9129d2513 |
| refName |
string |
Yes |
The branch name, tag name, or commit ID. Default value: the default branch of the code repository. |
master, tag1.0, or sjjfssa |
| start |
string |
No |
The start time. |
2022-03-18 08:00:00 |
| end |
string |
No |
The end time. |
2022-08-18 08:00:00 |
| page |
integer |
No |
The page number. Default value: 1. Pagination starts from page 1. |
1 |
| pageSize |
integer |
No |
The number of entries per page. Default value: 20. Valid values: 1 to 100. |
20 |
| path |
string |
No |
The file path in the code repository. This parameter is used to obtain the file directory under the specified path. By default, the entire structure of the code repository file tree is obtained. |
src/cpp/main.cpp |
| search |
string |
No |
The search keyword. |
search |
| showSignature |
boolean |
No |
Specifies whether to display the signature. Default value: false. |
false |
| showCommentsCount |
boolean |
No |
Specifies whether to display the number of comments. Default value: false. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
The request ID. |
F1138237-CF7F-56BF-95D4-9AA937CCE8E5 |
| errorMessage |
string |
The error message. |
"" |
| errorCode |
string |
The error code. |
OpenApi.error |
| success |
boolean |
Indicates whether the call was successful. |
true |
| total |
integer |
The total number of records. Important The commit list uses scroll pagination. The total count can be used for reference only and is not accurate. |
145 |
| result |
array<object> |
The list of returned results. |
|
|
array<object> |
The returned result. |
||
| id |
string |
The commit ID. |
de02b625ba8488f92eb204bcb3773a40c1b4ddac |
| shortId |
string |
The short commit ID. Example: Commit ID: ff4fb5ac6d1f44f452654336d2dba468ae6c8d04. Short ID: ff4fb5ac. |
de02b625 |
| title |
string |
The commit title, which is the first line of the commit message. |
Commit title |
| authorName |
string |
The name of the author. |
test-codeup |
| authorEmail |
string |
The email address of the author. |
username@example.com |
| createdAt |
string |
The creation time in the YYYY-MM-DD HH:mm:ss format. |
2022-03-18 14:24:54 |
| message |
string |
The commit message. |
The specific content of the commit |
| authoredDate |
string |
The time when the author made the commit, in the YYYY-MM-DD HH:mm:ss format. |
2022-03-18 15:00:00 |
| committedDate |
string |
The time when the committer made the commit, in the YYYY-MM-DD HH:mm:ss format. |
2022-03-18 16:00:00 |
| committerEmail |
string |
The email address of the committer. |
username@example.com |
| committerName |
string |
The name of the committer. |
committer-codeup |
| parentIds |
array |
The list of parent commit IDs. |
|
|
string |
The parent commit ID. |
ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 |
|
| author |
object |
The author information. |
|
| id |
integer |
The user ID in Codeup. |
7914 |
| name |
string |
The name of the user. |
Yunxiao |
| username |
string |
The user nickname. |
nickname |
| state |
string |
The status. Valid values: active and blocked. Default value: active. |
active |
| avatarUrl |
string |
The URL of the avatar. |
Avatar URL https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
| websiteUrl |
string |
The URL of the user's personal website. |
"" |
|
string |
The email address of the user. |
username@example.com |
|
| committer |
object |
The committer information. |
|
| id |
integer |
The user ID in Codeup. |
41031 |
| name |
string |
The name of the user. |
committer-codeup |
| username |
string |
The user nickname. |
nickname |
| state |
string |
The status. Valid values: active and blocked. Default value: active. |
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
| websiteUrl |
string |
The URL of the user's personal website. |
"" |
|
string |
The email address of the user. |
username@example.com |
|
| signature |
object |
The signature information. |
|
| gpgKeyId |
string |
The key ID of the GPG signature. |
”“ |
| verificationStatus |
string |
The GPG verification status. Valid values:
|
verified |
| commentsCount |
integer |
The number of comments. |
1 |
Examples
Success response
JSON format
{
"requestId": "F1138237-CF7F-56BF-95D4-9AA937CCE8E5",
"errorMessage": "\"\"",
"errorCode": "OpenApi.error",
"success": true,
"total": 145,
"result": [
{
"id": "de02b625ba8488f92eb204bcb3773a40c1b4ddac",
"shortId": "de02b625",
"title": "提交标题",
"authorName": "test-codeup",
"authorEmail": "username@example.com",
"createdAt": "2022-03-18 14:24:54",
"message": "提交的具体内容",
"authoredDate": "2022-03-18 15:00:00",
"committedDate": "2022-03-18 16:00:00",
"committerEmail": "username@example.com",
"committerName": "committer-codeup",
"parentIds": [
"ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 "
],
"author": {
"id": 7914,
"name": "云效",
"username": "nickname",
"state": "active",
"avatarUrl": "头像地址\n\nhttps://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"websiteUrl": "\"\"",
"email": "username@example.com"
},
"committer": {
"id": 41031,
"name": "committer-codeup",
"username": "nickname",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"websiteUrl": "\"\"",
"email": "username@example.com"
},
"signature": {
"gpgKeyId": "”“",
"verificationStatus": "verified"
},
"commentsCount": 1
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | Forbidden.AccessDenied | The user is not authorized to perform the operation. | The user is not authorized to perform the operation. |
| 403 | Forbidden.UserNotInCurrentOrganization | The user is not in the organization and is not authorized to perform the operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.