Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Obtaining the Language Information of the Code Navigation Function
Updated on 2026-05-12 GMT+08:00

Obtaining the Language Information of the Code Navigation Function

Function

This API is used to obtain the language information of the code navigation function.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

No identity policy-based permission required for calling this API.

URI

GET https://{hostURL}/v4/repositories/{repository_id}/repository/nav/language

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Definition

You can call the API used to query all repositories of the user to query the project list to obtain the repository ID.

Constraints

N/A

Default Value

N/A

Value range:

1~2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. You can obtain the token by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

A string that can contain 1 to 100,000 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

String

Definition

Result identifier.

Constraints

N/A

message

String

Definition

Result message.

Constraints

N/A

language_list

Array of LanguageDto objects

Definition

Language list.

Constraints

N/A

Table 4 LanguageDto

Parameter

Type

Description

name

String

Definition

Language name.

Constraints

N/A

Default value:

N/A

extension_list

Array of strings

Definition

File name extension.

Constraints

N/A

Example Requests

GET https://{endpoint}/v4/repositories/123/repository/nav/language

Example Responses

Status code: 200

OK

{
  "result" : "0",
  "message" : "",
  "language_list" : [ {
    "name" : "c",
    "extension_list" : [ ".c", ".h" ]
  }, {
    "name" : "cpp",
    "extension_list" : [ ".cpp", ".hpp", ".C", ".hxx", ".cc", ".cxx" ]
  }, {
    "name" : "go",
    "extension_list" : [ ".go" ]
  }, {
    "name" : "java",
    "extension_list" : [ ".java" ]
  }, {
    "name" : "javascript",
    "extension_list" : [ ".js" ]
  }, {
    "name" : "rust",
    "extension_list" : [ ".rs" ]
  }, {
    "name" : "ruby",
    "extension_list" : [ ".rb" ]
  }, {
    "name" : "php",
    "extension_list" : [ ".php" ]
  }, {
    "name" : "python",
    "extension_list" : [ ".py" ]
  }, {
    "name" : "csharp",
    "extension_list" : [ ".cs" ]
  }, {
    "name" : "scala",
    "extension_list" : [ ".scala" ]
  }, {
    "name" : "typescript",
    "extension_list" : [ ".ts" ]
  }, {
    "name" : "cangjie",
    "extension_list" : [ ".cangjie", ".cj" ]
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.