Help Center/ CodeArts Repo/ API Reference/ APIs/ Review/ Obtaining Review Settings
Updated on 2025-01-14 GMT+08:00

Obtaining Review Settings

Function

This API is used to obtain review settings.

URI

GET /v2/repositories/{repository_id}/review_setting

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Explanation:

Repository ID.

Constraints:

Mandatory

Range:

Minimum value: 1

Maximum value: 2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error code.

result

ReviewSettingDto object

Explanation:

Review comment information.

Range:

None

status

String

Explanation:

Response status.

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Error

Parameter

Type

Description

code

String

Explanation:

Error code returned when the API fails to be called.

Range:

  • CH.10000. The system is busy. Try again later.

message

String

Explanation:

Error message returned when the API fails to be called.

Range:

  • The system is busy. Try again later.
Table 5 ReviewSettingDto

Parameter

Type

Description

categories_and_modules_enabled

Boolean

Explanation:

Whether to enable review comment types and modules.

Range:

  • true: Yes
  • false: No

secondary_category_enabled

Boolean

Explanation:

Whether to enable preset review comment types.

Range:

  • true: Yes
  • false: No. You can select desired types or add custom ones.

primary_categories

Array of CategoryDto objects

Explanation:

Selected types.

Range:

None

review_default_categories

Array of strings

Explanation:

Keys of selected types.

Range:

None

review_customized_categories

Array of strings

Explanation:

Custom types.

Range:

Max.: 20.

Max. length each: 200 characters.

Characters: Unicode \u0000 to \uffff. Special characters, such as emojis and uncommon characters, are not supported.

Blank: The value cannot be null, an empty string, or only spaces.

review_modules

Array of strings

Explanation:

Review comment module.

Range:

Max.: 20.

Ma. length each: 200 characters.

Characters: Unicode \u0000 to \uffff. Special characters, such as emojis and uncommon characters, are not supported.

Blank: The value cannot be null, an empty string, or only spaces.

source_id

Integer

Explanation:

Repository ID.

Range:

Minimum value: 1

Maximum value: 2147483647

source_type

String

Explanation:

Project type. Currently, only one project type is supported.

Range:

  • Project

source_path

String

Explanation:

Repository path.

Range:

None

secondary_category_type

String

Explanation:

Preset review comment type (discarded field).

Range:

HiCode

secondary_categories

Array of CategoryDto objects

Explanation:

Preset review comment.

Range:

None

Table 6 CategoryDto

Parameter

Type

Description

key

String

Explanation:

Key of a preset review comment type.

Range:

None

name_zh

String

Explanation:

Name of a preset review comment type in Chinese.

Range:

None

name_en

String

Explanation:

Name of a preset review comment type in English.

Range:

None

sub_categories

Array of CategoryDto objects

Explanation:

Subtype of a preset review comment type.

Range:

None

Example Requests

GET https://{endpoint}/v2/repositories/{repository_id}/review_setting

Example Responses

Status code: 200

OK

{
    "result": {
        "categories_and_modules_enabled": true,
        "secondary_category_enabled": false,
        "primary_categories": [
            {
                "key": "realize",
                "name_zh": "Algorithm",
                "name_en": "Algorithm"
            }
        ],
        "review_default_categories": [
            "realize"
        ],
        "review_customized_categories": [
            "Type"
        ],
        "review_modules": [
            "Module"
        ],
        "source_id": 2111704470,
        "source_type": "Project",
        "source_path": "sll_test00006/mr_test"
    },
    "status": "success"
}

Status Codes

Status Code

Description

200

OK