Obtaining the Merge Request Commit List
Function
This API is used to obtain the merge request commit list.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET https://{hostURL}/v4/repositories/{repository_id}/merge-requests/{merge_request_iid}/commits
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | Integer | Definition You can query the project list to obtain the repository ID by calling the API used to query user's all repositories. Constraints N/A. Value range: 1~2147483647 |
| merge_request_iid | Yes | Integer | Definition MR internal ID (IID). Value range: 1~2147483647 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| view | No | String | Definition Whether to display commits in the simple mode. If simple is passed, commits are displayed in the simple mode. Otherwise, commits are normally displayed. Constraints Enumeration values: |
| offset | No | Integer | Definition Offset, which starts from 0. Value range: 0~2147483647 Default value: 0 |
| limit | No | Integer | Definition Number of returned records. Value range: 1~100 Default value: 20 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints Mandatory. Range 1–100,000 characters. Default Value N/A. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| [items] | Array of MergeRequestCommitDto objects | MR commit list details |
| Parameter | Type | Description |
|---|---|---|
| id | String | commit id |
| short_id | String | Commit short ID |
| title | String | Commit title |
| message | String | Commit message |
| author_name | String | Commit author name |
| name | String | Username |
| user_name | String | Username |
| tenant_name | String | Tenant name |
| nick_name | String | Alias |
| authored_date | String | Initial commit date (local commit date) |
| committed_date | String | Commit date (date when the commit is pushed to the repository) |
| committer_name | String | Committer name |
| gpg_primary_key_id | String | pgp key id |
| open_gpg_verified | Boolean | Whether GPG public key verification is enabled |
| verification_status | Boolean | Whether GPG public key verification is passed |
| parent_ids | Array of strings | Commit parent commit node |
| created_at | String | Commit creation time recorded in the database |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Example Requests
None
Example Responses
Status code: 200
OK
{
"id" : "c31a08bc85418c82f96e70fed197781ad62d3891",
"short_id" : "c31a08bc",
"title" : "Update dev",
"message" : "Update dev",
"author_name" : "example_name",
"name" : "example.com",
"user_name" : "example_name",
"tenant_name" : "example_name",
"nick_name" : "example_name",
"authored_date" : "2024-12-18T16:09:26.000+08:00",
"committed_date" : "2024-12-18T16:09:26.000+08:00",
"committer_name" : "2024-12-18T16:09:26.000+08:00",
"gpg_primary_key_id" : "87E44B5F42161434",
"open_gpg_verified" : true,
"verification_status" : 1,
"parent_ids" : [ "ee792e378901e39008c6cbdd5bf01b056ba56e9b" ],
"created_at" : "2024-12-18T16:09:26.000+08:00"
} Status code: 400
Bad Request
{
"error_code" : "CH.00405011",
"error_msg" : "Request error."
} Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.