# Method: projects.locations.connections.repositories.accessReadToken

- [HTTP request](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.request_body)
- [Response body](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.FetchReadTokenResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/accessReadToken#try-it)

Fetches read token of a given repository.

### HTTP request

`POST https://cloudbuild.googleapis.com/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:accessReadToken`

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

### Path parameters

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

### Request body

The request body must be empty.

### Response body

Message for responding to get read token.

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

| JSON representation |
|---|
| ``` { "token": string, "expirationTime": string } ``` |

| Fields ||
|---|---|
| `token` | `string` The token content. |
| `expirationTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Expiration timestamp. Can be empty if unknown or non-expiring. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |

### Authorization scopes

Requires the following OAuth scope:

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

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

### IAM Permissions

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

- `cloudbuild.repositories.accessReadToken`

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