Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

Method: customers.batchJobs.addOperations

Add operations to the batch job.

List of thrown errors: AuthenticationError AuthorizationError BatchJobError HeaderError InternalError QuotaError RequestError ResourceCountLimitExceededError

HTTP request

POST https://googleads.googleapis.com/v7/{resourceName=customers/*/batchJobs/*}:addOperations

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
resourceName

string

Required. The resource name of the batch job.

Request body

The request body contains data with the following structure:

JSON representation
{
  "sequenceToken": string,
  "mutateOperations": [
    {
      object (MutateOperation)
    }
  ]
}
Fields
sequenceToken

string

A token used to enforce sequencing.

The first batchJobs.addOperations request for a batch job should not set sequenceToken. Subsequent requests must set sequenceToken to the value of nextSequenceToken received in the previous batchJobs.addOperations response.

mutateOperations[]

object (MutateOperation)

Required. The list of mutates being added.

Operations can use negative integers as temp ids to signify dependencies between entities created in this batch job. For example, a customer with id = 1234 can create a campaign and an ad group in that same campaign by creating a campaign in the first operation with the resource name explicitly set to "customers/1234/campaigns/-1", and creating an ad group in the second operation with the campaign field also set to "customers/1234/campaigns/-1".

Response body

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

Response message for BatchJobService.AddBatchJobOperations.

JSON representation
{
  "totalOperations": string,
  "nextSequenceToken": string
}
Fields
totalOperations

string (int64 format)

The total number of operations added so far for this batch job.

nextSequenceToken

string

The sequence token to be used when calling batchJobs.addOperations again if more operations need to be added. The next batchJobs.addOperations request must set the sequenceToken field to the value of this field.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/adwords

For more information, see the OAuth 2.0 Overview.