- [HTTP request](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.request_body)
- [Response body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.FetchGitRepositoryLinkFileBlameResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#body.aspect_1)
- [BlameRange](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#BlameRange)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#BlameRange.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#try-it)

Fetches blame information for a file or line range in a file.

### HTTP request

`GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchFileBlame`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the GitRepositoryLink in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. |

### Query parameters

| Parameters ||
|---|---|
| `ref` | `string` Required. The SCM commit SHA, or symbolic revision (for example, branch name, tag) from which to fetch the blame. |
| `path` | `string` Required. The file path within the repository. |
| `firstLine` | `integer` Optional. The 1-indexed starting line number of the range to blame (inclusive). If not specified, blame begins at line 1. |
| `lastLine` | `integer` Optional. The 1-indexed ending line number of the range to blame (inclusive). If not specified, blame extends to the end of the file. |

### Request body

The request body must be empty.

### Response body

Response message for gitRepositoryLinks.fetchFileBlame.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "ranges": [ { object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#BlameRange`) } ] } ``` |

| Fields ||
|---|---|
| `ranges[]` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchFileBlame#BlameRange`)`` The list of blame ranges for the file. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `developerconnect.gitRepositoryLinks.fetchFileBlame`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## BlameRange

BlameRange represents blame information for a range of lines.

| JSON representation |
|---|
| ``` { "firstLine": integer, "lastLine": integer, "commit": { object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/SCMCommit`) } } ``` |

| Fields ||
|---|---|
| `firstLine` | `integer` The 1-indexed starting line number of the range (inclusive). |
| `lastLine` | `integer` The 1-indexed ending line number of the range (inclusive). |
| `commit` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/SCMCommit`)`` The commit metadata for this line range. |