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

Obtaining the Code Navigation Reference Relationships

Function

This API is used to obtain the code navigation reference relationships.

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/references

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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

path

No

String

Definition

File path.

Range

1–100,000 characters.

revision

No

String

Definition

Version commit ID.

Range

N/A

ref

No

String

Definition

Reference, which can be a branch name, label name, or commit ID. If this parameter is not transferred, the default branch is used.

Range

1–2,000 characters.

symbol

Yes

String

Definition

Search symbol (string selected on the page).

Range

N/A

language

Yes

String

Definition

Coding language.

Range

  • C

  • C++

  • Go

  • Java

  • JavaScript

  • PHP

  • Python

  • Ruby

  • Rust

blob

Yes

String

Definition

Blob file ID. You can call the API used to query file information of a repository to query the file information of a repository to obtain the ID.

Range

N/A

file_path

Yes

String

Definition

File path.

Range

1–10,000 characters.

Request Parameters

Table 3 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 4 Response body parameters

Parameter

Type

Description

result

String

Definition

Result identifier.

Constraints

N/A

message

String

Definition

Result message.

Constraints

N/A

defs

Array of DefEntryDto objects

Definition

Node information.

Constraints

N/A

refs

Array of RefEntryDto objects

Definition

Index information list.

Constraints

N/A

Table 5 DefEntryDto

Parameter

Type

Description

tag_name

String

Definition

Label name.

Constraints

N/A

file_path

String

Definition

File path.

Constraints

N/A

blob

String

Definition

Blob file ID.

Constraints

N/A

line_image

String

Definition

Brief content in the index row.

Constraints

N/A

line_number

Integer

Definition

Row No.

Constraints

N/A

range

String

Definition

Range information.

Constraints

N/A

syntax_type

String

Definition

Syntax type.

Constraints

N/A

revision

String

Definition

Version number (commit ID).

Constraints

N/A

extend

String

Definition

Other information.

Constraints

N/A

Table 6 RefEntryDto

Parameter

Type

Description

tag_name

String

Definition

Label name.

Constraints

N/A

file_path

String

Definition

File path.

Constraints

N/A

blob

String

Definition

Blob file ID.

Constraints

N/A

line_image

String

Definition

Brief content in the index row.

Constraints

N/A

line_number

Integer

Definition

Row No.

Constraints

N/A

syntax_type

String

Definition

Syntax type.

Constraints

N/A

revision

String

Definition

Version number (commit ID).

Constraints

N/A

extend

String

Definition

Other information.

Constraints

N/A

Example Requests

GET https://{endpoint}/v4/repositories/123/repository/nav/references?ref=test&file_path=aes.utlil.java&symbol=apache&revision=745cde5c18f0cxxx127db2c8e8a65856f8d&row=8&col=18&project_id=32&language=java&blob=b647455b7a4854xxxs6a3fa1a8

Example Responses

Status code: 200

OK

{
  "result" : "0",
  "message" : "",
  "defs" : [ ],
  "refs" : [ {
    "tag_name" : "ObjectMapper",
    "file_path" : "Test.java",
    "blob" : "69db78cd4b81ebxxxx38149771852e7f7da71",
    "line_image" : "import com.fasterxml.jackson.databind.ObjectMapper;",
    "line_number" : 10,
    "syntax_type" : "variable",
    "revision" : "23af980a1xxxxc1d3c9e4b8e3f25ba5c9c3aa",
    "extend" : ""
  }, {
    "tag_name" : "ObjectMapper",
    "file_path" : "Test2.java",
    "blob" : "69db78cd4b81eb82f214838149771852e7f7da71",
    "line_image" : "    private static final ObjectMapper OBJECT_MAPPER = new                 ObjectMapper();",
    "line_number" : 26,
    "syntax_type" : "variable",
    "revision" : "23af980a11c1xxxxd3c9e4b8e3f25ba5c9c3aa",
    "extend" : ""
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.