Obtaining the MR list on the homepage
Function
This API is used to obtain the MR list on your homepage.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartsrepo:repository:getMergeRequest |
Read |
- |
- |
- |
- |
URI
GET https://{hostURL}/v4/merge-requests
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
state |
No |
String |
Definition: Merge request status Constraints:
Default value: all Enumeration values:
|
|
order_by |
No |
String |
Definition: Sorting method Constraints:
Default value: created_at Enumeration values:
|
|
sort |
No |
String |
Definition: Sorting order Constraints:
Default value: desc Enumeration values:
|
|
labels |
No |
String |
Definition: Label associated with the merge request. |
|
created_before |
No |
String |
Definition: Created before the specified time |
|
created_after |
No |
String |
Definition: Created after the specified time |
|
updated_after |
No |
String |
Definition: Update after the specified time |
|
updated_before |
No |
String |
Definition: Update before the specified time |
|
view |
No |
String |
Definition: Result set attribute. Different results are returned based on the given parameters. simple: simple data; basic: basic data Enumeration values:
|
|
author_id |
No |
String |
Definition: Merge request creator |
|
scope |
No |
String |
Definition:
Enumeration values:
|
|
source_branch |
No |
String |
Definition: Original merge request branch |
|
target_branch |
No |
String |
Definition: MR target branch |
|
search |
No |
String |
Definition: Filter keywords based on the merge request header and description |
|
wip |
No |
String |
Definition: Whether the merge request title contains the keyword WIP Enumeration values:
|
|
merged_by |
No |
String |
Definition: MR merger |
|
merged_after |
No |
String |
Definition: Merged after the specified time |
|
merged_before |
No |
String |
Definition: Merged before the specified time |
|
offset |
No |
Integer |
Definition: Pagination parameter offset |
|
limit |
No |
Integer |
Definition: Maximum number of records on a page. |
|
only_count |
No |
Boolean |
Definition: Whether to return only the total number of merge requests Default value: false |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints N/A Range 1–100,000 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
X-Total |
String |
Definition Total number of MRs on the personal homepage. |
|
Parameter |
Type |
Description |
|---|---|---|
|
[items] |
Array of MergeRequestListBasicDto objects |
MR basic information |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Definition MR ID. |
|
iid |
Integer |
Definition No. of the MR located in the current repository. |
|
title |
String |
Definition MR title. |
|
source_branch |
String |
Definition MR source branch. |
|
target_branch |
String |
Definition MR target branch. |
|
state |
String |
Definition MR status. |
|
created_at |
String |
Definition Time when an MR was created. |
|
updated_at |
String |
Definition MR update time. |
|
source_repository_id |
Integer |
Definition MR source repository ID. |
|
review_mode |
String |
Definition MR review mode. |
|
author |
UserBasicDto object |
Definition MR author. |
|
closed_at |
String |
Definition Time when an MR was closed. |
|
closed_by |
UserBasicDto object |
Definition MR closer. |
|
merged_at |
String |
Definition Time when an MR was merged. |
|
merged_by |
UserBasicDto object |
Definition MR merger. |
|
pipeline_status |
String |
Definition MR pipeline status. |
|
codequality_status |
String |
Definition MR code quality status. |
|
pipeline_status_with_code_quality |
String |
Definition MR pipeline status. |
|
notes |
Integer |
Definition MR review comment. |
|
source_repository |
ProjectSimpleDto object |
Definition MR source repository information. |
|
target_repository |
ProjectSimpleDto object |
Definition MR target repository information. |
|
web_url |
String |
Definition MR URL. |
|
added_lines |
Integer |
Definition Lines of code added in an MR. |
|
removed_lines |
Integer |
Definition Lines of code deleted in an MR. |
|
merge_request_type |
String |
Definition MR review mode. |
|
source_git_url |
String |
Definition MR Git address. |
|
labels |
Array of Map<String,Object> objects |
Definition MR label. |
|
score |
Integer |
Definition MR score. |
|
min_merged_score |
Integer |
Definition Minimum merge score of an MR. |
|
source_product_id |
String |
Definition MR source project ID. |
|
target_product_id |
String |
Definition MR target project ID. |
|
product_name |
String |
Definition MR project name. |
|
notes_count |
NotesCountDto object |
Definition Number of MR review comments. |
|
moderation_result |
Boolean |
Definition MR approving result. |
|
moderation_time |
Long |
Definition MR approving time. |
|
moderation_status |
Integer |
Definition MR approving status. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Definition User ID. Value range: 1~2147483647 |
|
name |
String |
Definition Username. |
|
username |
String |
Definition Username. |
|
state |
String |
Definition: User status Value range:
Enumeration values:
|
|
service_license_status |
Integer |
Service-level permission status. 0: disabled; 1: enabled |
|
avatar_url |
String |
User profile picture URL |
|
avatar_path |
String |
User profile picture path |
|
|
String |
User email |
|
name_cn |
String |
Username (CN) |
|
web_url |
String |
User homepage |
|
nick_name |
String |
User alias |
|
tenant_name |
String |
Tenant name |
|
error_message |
String |
Definition When some query APIs detect that the user permission in the transfer parameter is insufficient or the user does not exist, the user is returned but the field is not empty for information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Repository ID. |
|
description |
String |
Repository description |
|
name |
String |
Repository name |
|
name_with_namespace |
String |
Organization name/Organization name.../Repository name |
|
path |
String |
Repository path |
|
path_with_namespace |
String |
Complete repository path |
|
created_at |
String |
Creation time |
|
updated_at |
String |
Update time. |
|
archived |
Boolean |
Archived or not |
|
is_kia |
Boolean |
Confidential or not |
|
ssh_url_to_repo |
String |
Repository SSH address |
|
http_url_to_repo |
String |
Repository HTTP address |
|
web_url |
String |
Repository page link |
|
readme_url |
String |
Link to the readme file of the repository |
|
project_id |
String |
Project ID |
|
project_name |
String |
Project name |
|
develop_mode |
String |
Repository development modes: normal and CR |
|
moderation_result |
Boolean |
Approving status |
|
Parameter |
Type |
Description |
|---|---|---|
|
notes_count |
Integer |
Total number of review comments |
|
unresolved_notes_count |
Integer |
Number of unresolved review comments |
|
already_resolved_count |
Integer |
Number of resolved review comments |
|
need_resolved_count |
Integer |
Total number of review comments to be resolved |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Example Requests
/v4/merge-requests
Example Responses
Status code: 200
OK
{
"id" : 72674,
"iid" : 7,
"title" : "Create a file",
"source_branch" : "ddd1",
"target_branch" : "master",
"state" : "opened",
"created_at" : "2025-05-21T12:03:32.000+08:00",
"updated_at" : "2025-06-17T15:30:02.000+08:00",
"source_repository_id" : 2111983939,
"review_mode" : "approval",
"author" : {
"id" : 9124,
"name" : "test",
"username" : "c369c68f1ff84679b5a8ed904d8bff1c",
"state" : "active",
"service_license_status" : null,
"name_cn" : "test",
"nick_name" : "beta_dv",
"tenant_name" : "example_name",
"error_message" : null
},
"closed_at" : "2025-05-21T12:03:32.000+08:00",
"closed_by" : null,
"merged_at" : null,
"merged_by" : null,
"pipeline_status" : "",
"codequality_status" : null,
"pipeline_status_with_code_quality" : "",
"notes" : 0,
"web_url" : "https://example.com/********/2111983939/7/mergedetail?source=ddd1&target=master",
"added_lines" : 0,
"removed_lines" : 0,
"merge_request_type" : "MergeRequest",
"source_git_url" : "git@example.com:3e1f6634946144c2b1ccb46fb8152b8f/dddd.git",
"labels" : [ {
"color" : "#000",
"name" : "Bug",
"description" : "456",
"id" : 8,
"title" : "Bug",
"type" : null,
"textColor" : "#FFFFFF"
}, {
"color" : "#000",
"name" : "bug",
"description" : "456",
"id" : 7,
"title" : "bug",
"type" : null,
"textColor" : "#FFFFFF"
} ],
"score" : 0,
"min_merged_score" : null,
"source_project_id" : "3e1f6634946144c2b1ccb46fb8152b8f",
"target_project_id" : null,
"product_name" : null,
"notes_count" : null,
"moderation_result" : null,
"moderation_time" : null,
"moderation_status" : null,
"source_repository" : {
"id" : 2111983939,
"description" : "ddd",
"name" : "dddd",
"name_with_namespace" : "3e1f6634946144c2b1ccb46fb8152b8f / dddd",
"path" : "dddd",
"path_with_namespace" : "3e1f6634946144c2b1ccb46fb8152b8f/dddd",
"created_at" : "2024-11-30T17:46:46.000+08:00",
"updated_at" : "2024-11-30T17:46:46.000+08:00",
"archived" : false,
"ssh_url_to_repo" : "git@example.com:3e1f6634946144c2b1ccb46fb8152b8f/dddd.git",
"http_url_to_repo" : "https://example.com/3e1f6634946144c2b1ccb46fb8152b8f/dddd.git",
"project_id" : null,
"project_name" : null,
"develop_mode" : null,
"moderation_result" : null
},
"target_repository" : {
"id" : 2111983939,
"description" : "ddd",
"name" : "dddd",
"name_with_namespace" : "3e1f6634946144c2b1ccb46fb8152b8f / dddd",
"path" : "dddd",
"path_with_namespace" : "3e1f6634946144c2b1ccb46fb8152b8f/dddd",
"created_at" : "2024-11-30T17:46:46.000+08:00",
"updated_at" : "2024-11-30T17:46:46.000+08:00",
"archived" : false,
"ssh_url_to_repo" : "git@example.com:3e1f6634946144c2b1ccb46fb8152b8f/dddd.git",
"http_url_to_repo" : "https://example.com/3e1f6634946144c2b1ccb46fb8152b8f/dddd.git",
"project_id" : null,
"project_name" : null,
"develop_mode" : null,
"moderation_result" : null
}
}
Status code: 401
Unauthorized
{
"error_code" : "CH.00000002",
"error_msg" : "Recognize authentication information failed."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot