Obtaining File Tracing Information
Function
This API is used to obtain file tracing information.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET https://{hostURL}/v4/repositories/{repository_id}/repository/blame
| 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. Value range: 1~2147483647 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| file_path | Yes | String | Definition File path. Range 1–10,000 characters. |
| sha | Yes | String | Definition Branch name, tag name, or commit ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints Mandatory. Range 1–100,000 characters. Default Value N/A. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| [items] | Array of BlameDto objects | Source tracing information. |
| Parameter | Type | Description |
|---|---|---|
| commit | RepositoryCommitDto object | A commit. |
| avatar_url | String | Definition Profile picture link. Range N/A |
| lines | Array of LineContentDto objects | Line information. |
| nick_name | String | Definition Alias Range N/A |
| tenant_name | String | Definition Tenant name. Range N/A |
| user_name | String | Definition Username. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | id |
| message | String | Message |
| parent_ids | Array of strings | Parent node commit ID |
| authored_date | String | Time when the branch was created. |
| author_name | String | Creator name |
| author_email | String | Creator's email. |
| committed_date | String | Code commit date and time |
| committer_name | String | Committer name |
| committer_email | String | Committer email |
| open_gpg_verified | Boolean | Whether to enable the GPG verification |
| verification_status | Integer | Verification status Value range: 0~1 |
| gpg_primary_key_id | String | Identifier of the GPG public key |
| name | String | Username |
| gpg_nick_name | String | Alias |
| gpg_tenant_name | String | Tenant name |
| gpg_user_name | String | Information about a specific GPG user |
| Parameter | Type | Description |
|---|---|---|
| lineNO | Integer | Definition Number of lines in the file. Value range: 1~2147483647 |
| content | String | Definition Code line content. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. |
| error_msg | String | Definition Error message. |
Example Requests
GET https://{endpoint}/v4/repositories/2112029050/repository/blame?sha=master&file_path=dad Example Responses
Status code: 200
File source tracing information.
[ {
"commit" : {
"description" : "Commit message.",
"id" : "92a2693452eea84d3c07850310a63028a82173d4",
"message" : "Update dad",
"parent_ids" : "[test01,test02]",
"authored_date" : "2025-06-14T06:53:58.000Z",
"author_name" : "adad",
"author_email" : "aa@example.com",
"committed_date" : "2025-06-14T06:53:58.000Z",
"committer_name" : "adad",
"committer_email" : "aa@example.com",
"open_gpg_verified" : true,
"verification_status" : 1,
"gpg_primary_key_id" : "87E44B5F42161434",
"name" : "eamll.com",
"gpg_nick_name" : null,
"gpg_tenant_name" : null,
"gpg_user_name" : null
},
"avatar_url" : "",
"lines" : [ {
"lineNO" : 2,
"content" : "adad"
}, {
"lineNO" : 3,
"content" : "dad2"
} ],
"nick_name" : "aaa",
"tenant_name" : "aaaa",
"user_name" : "aaaaa"
} ] Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
} Status code: 403
Bad Request
{
"error_code" : "CH.004403",
"error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | File source tracing information. |
| 401 | Unauthorized |
| 403 | Bad Request |
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.