Search Ads 360 Reporting API . customers . customAudiences

Instance Methods

close()

Close httplib2 connections.

mutate(customerId, body=None, x__xgafv=None)

Creates or updates custom audiences. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CustomAudienceError]() [CustomInterestError]() [FieldError]() [FieldMaskError]() [HeaderError]() [InternalError]() [MutateError]() [OperationAccessDeniedError]() [PolicyViolationError]() [QuotaError]() [RequestError]()

Method Details

close()
Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates or updates custom audiences. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CustomAudienceError]() [CustomInterestError]() [FieldError]() [FieldMaskError]() [HeaderError]() [InternalError]() [MutateError]() [OperationAccessDeniedError]() [PolicyViolationError]() [QuotaError]() [RequestError]()

Args:
  customerId: string, Required. The ID of the customer whose custom audiences are being modified. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for CustomAudienceService.MutateCustomAudiences.
  "operations": [ # Required. The list of operations to perform on individual custom audiences.
    { # A single operation (create, update) on a custom audience.
      "create": { # A custom audience. This is a list of users by interest. The unique key of a custom audience consists of the following fields: name. Violating the unique key constraint produces error: CustomAudienceError.NAME_ALREADY_USED # Create operation: No resource name is expected for the new custom audience.
        "description": "A String", # Description of this custom audience.
        "id": "A String", # Output only. ID of the custom audience.
        "members": [ # List of custom audience members that this custom audience is composed of. Members can be added during CustomAudience creation. If members are presented in UPDATE operation, existing members will be overridden.
          { # A member of custom audience. A member can be a KEYWORD, URL, PLACE_CATEGORY or APP. It can only be created or removed but not changed.
            "app": "A String", # A package name of Android apps which users installed such as com.google.example.
            "keyword": "A String", # A keyword or keyword phrase — at most 10 words and 80 characters. Languages with double-width characters such as Chinese, Japanese, or Korean, are allowed 40 characters, which describes the user's interests or actions.
            "memberType": "A String", # The type of custom audience member, KEYWORD, URL, PLACE_CATEGORY or APP.
            "placeCategory": "A String", # A place type described by a place category users visit.
            "url": "A String", # An HTTP URL, protocol-included — at most 2048 characters, which includes contents users have interests in.
          },
        ],
        "name": "A String", # Name of the custom audience. It should be unique for all custom audiences created by a customer. This field is required for creating operations.
        "resourceName": "A String", # Immutable. The resource name of the custom audience. Custom audience resource names have the form: `customers/{customer_id}/customAudiences/{custom_audience_id}`
        "status": "A String", # Output only. Status of this custom audience. Indicates whether the custom audience is enabled or removed.
        "type": "A String", # Type of the custom audience. ("INTEREST" OR "PURCHASE_INTENT" is not allowed for newly created custom audience but kept for existing audiences)
      },
      "remove": "A String", # Remove operation: A resource name for the removed custom audience is expected, in this format: `customers/{customer_id}/customAudiences/{custom_audience_id}`
      "update": { # A custom audience. This is a list of users by interest. The unique key of a custom audience consists of the following fields: name. Violating the unique key constraint produces error: CustomAudienceError.NAME_ALREADY_USED # Update operation: The custom audience is expected to have a valid resource name.
        "description": "A String", # Description of this custom audience.
        "id": "A String", # Output only. ID of the custom audience.
        "members": [ # List of custom audience members that this custom audience is composed of. Members can be added during CustomAudience creation. If members are presented in UPDATE operation, existing members will be overridden.
          { # A member of custom audience. A member can be a KEYWORD, URL, PLACE_CATEGORY or APP. It can only be created or removed but not changed.
            "app": "A String", # A package name of Android apps which users installed such as com.google.example.
            "keyword": "A String", # A keyword or keyword phrase — at most 10 words and 80 characters. Languages with double-width characters such as Chinese, Japanese, or Korean, are allowed 40 characters, which describes the user's interests or actions.
            "memberType": "A String", # The type of custom audience member, KEYWORD, URL, PLACE_CATEGORY or APP.
            "placeCategory": "A String", # A place type described by a place category users visit.
            "url": "A String", # An HTTP URL, protocol-included — at most 2048 characters, which includes contents users have interests in.
          },
        ],
        "name": "A String", # Name of the custom audience. It should be unique for all custom audiences created by a customer. This field is required for creating operations.
        "resourceName": "A String", # Immutable. The resource name of the custom audience. Custom audience resource names have the form: `customers/{customer_id}/customAudiences/{custom_audience_id}`
        "status": "A String", # Output only. Status of this custom audience. Indicates whether the custom audience is enabled or removed.
        "type": "A String", # Type of the custom audience. ("INTEREST" OR "PURCHASE_INTENT" is not allowed for newly created custom audience but kept for existing audiences)
      },
      "updateMask": "A String", # FieldMask that determines which resource fields are modified in an update.
    },
  ],
  "validateOnly": True or False, # If true, the request is validated but not executed. Only errors are returned, not results.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for custom audience mutate.
  "results": [ # All results for the mutate.
    { # The result for the custom audience mutate.
      "resourceName": "A String", # Returned for successful operations.
    },
  ],
}