Obtaining the Merge Request Score
Function
This API is used to obtain the merge request score.
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/repositories/{repository_id}/merge-requests/{merge_request_iid}/votes
|
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 Default Value N/A Value range: 1~2147483647 |
|
merge_request_iid |
Yes |
Integer |
Definition MR internal ID (IID). Value range: 1~2147483647 |
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 |
|---|---|---|
|
scores |
Integer |
Definition Total score of all scorers. Value range: -2147483648~2147483647 |
|
merge_request_id |
Integer |
Definition MR ID. Value range: 1~2147483647 |
|
merge_request_creator |
String |
Definition MR author name. |
|
votes |
Array of MergeRequestVotesDto objects |
Definition Score details of a scorer. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Definition Scoring record ID. Value range: 1~2147483647 |
|
score |
Integer |
Definition Score. Value range: -2~2 |
|
author_name |
String |
Definition Author. |
|
author_username |
String |
Definition Author username. |
|
created_at |
String |
Definition Creation time. |
|
updated_at |
String |
Definition Update time. |
|
last_committed_id |
String |
Definition ID of the last commit record. |
|
author_id |
Integer |
Definition Author ID. |
|
avatar_url |
String |
Definition Author profile picture URL. |
|
nick_name |
String |
Definition Author alias. |
|
tenant_name |
String |
Definition Author tenant name. |
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
{
"scores" : -1,
"merge_request_id" : 3276215,
"merge_request_creator" : "zhangsan",
"votes" : [ {
"id" : 801569,
"score" : 1,
"author_name" : "example_name",
"author_username" : "example_name",
"created_at" : "2025-06-10T17:22:44.249+08:00",
"updated_at" : "2025-06-10T17:22:44.249+08:00",
"last_committed_id" : "709acacadc93b51470441375209278276c93af92",
"author_id" : 57858,
"avatar_url" : "https://example.com/w3lab/rest/yellowpage/face/example_name/120"
}, {
"id" : 801568,
"score" : -2,
"author_name" : "zhangsan",
"author_username" : "ex",
"created_at" : "2025-06-10T17:22:26.008+08:00",
"updated_at" : "2025-06-10T17:22:26.008+08:00",
"last_committed_id" : "709acacadc93b51470441375209278276c93af92",
"author_id" : 84986,
"avatar_url" : "https://example.com/w3lab/rest/yellowpage/face/ex/120"
} ]
}
Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
}
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