- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- TransactionOptions
- ReadWrite
- ReadOnly
- Try it!
Begins a new transaction.
HTTP request
POST https://datastore.googleapis.com/v1beta3/projects/{projectId}:beginTransaction
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
projectId
|
Required. The ID of the project against which to make the request. |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"transactionOptions"
:
{
object (
|
| Fields | |
|---|---|
transactionOptions
|
Options for a new transaction. |
Response body
The response for Datastore.BeginTransaction
.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "transaction" : string } |
| Fields | |
|---|---|
transaction
|
The transaction identifier (always present). A base64-encoded string. |
Authorization scopes
Requires one of the following OAuth scopes:
-
https://www.googleapis.com/auth/datastore -
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview .
TransactionOptions
Options for beginning a new transaction.
Transactions can be created explicitly with calls to Datastore.BeginTransaction
or implicitly by setting ReadOptions.new_transaction
in read requests.
| JSON representation |
|---|
{ // Union field |
ReadWrite
Options specific to read / write transactions.
| JSON representation |
|---|
{ "previousTransaction" : string } |
| Fields | |
|---|---|
previousTransaction
|
The transaction identifier of the transaction being retried. A base64-encoded string. |
ReadOnly
Options specific to read-only transactions.
| JSON representation |
|---|
{ "readTime" : string } |
| Fields | |
|---|---|
readTime
|
Reads entities at the given time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |

