Display & Video 360 API . advertisers . adAssets

Instance Methods

bulkCreate(advertiserId, body=None, x__xgafv=None)

Creates multiple ad assets in a single request. Returns the newly-created ad assets if successful. Only supports the creation of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

close()

Close httplib2 connections.

create(advertiserId, body=None, x__xgafv=None)

Creates an ad asset. Returns the newly-created ad asset if successful. Only supports the creation of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

get(advertiserId, adAssetId, x__xgafv=None)

Gets an ad asset. Only supports the retrieval of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

list(advertiserId, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)

Lists ad assets under an advertiser ID. Only supports the retrieval of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

list_next()

Retrieves the next page of results.

upload(advertiserId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)

Uploads and creates an ad asset. Returns the ID of the newly-created ad asset if successful. Only supports the uploading of assets with the AdAssetType `AD_ASSET_TYPE_IMAGE`.

Method Details

bulkCreate(advertiserId, body=None, x__xgafv=None)
Creates multiple ad assets in a single request. Returns the newly-created ad assets if successful. Only supports the creation of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

Args:
  advertiserId: string, Required. The ID of the advertiser these ad assets belong to. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request message for BulkCreateAdAssets.
  "adAssets": [ # Required. Ad assets to create. Only supports assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.
    { # A single ad asset.
      "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
      "adAssetType": "A String", # Required. The type of the ad asset.
      "entityStatus": "A String", # Output only. The entity status of the ad asset.
      "name": "A String", # Identifier. The resource name of the ad asset.
      "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
        "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
      },
    },
  ],
}

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

Returns:
  An object of the form:

    { # A response message for BulkCreateAdAssets.
  "adAssets": [ # The created ad assets.
    { # A single ad asset.
      "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
      "adAssetType": "A String", # Required. The type of the ad asset.
      "entityStatus": "A String", # Output only. The entity status of the ad asset.
      "name": "A String", # Identifier. The resource name of the ad asset.
      "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
        "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
      },
    },
  ],
}
close()
Close httplib2 connections.
create(advertiserId, body=None, x__xgafv=None)
Creates an ad asset. Returns the newly-created ad asset if successful. Only supports the creation of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

Args:
  advertiserId: string, Required. The ID of the advertiser this ad asset belongs to. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request message for CreateAdAsset.
  "adAsset": { # A single ad asset. # Required. The ad asset to create. Only supports assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.
    "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
    "adAssetType": "A String", # Required. The type of the ad asset.
    "entityStatus": "A String", # Output only. The entity status of the ad asset.
    "name": "A String", # Identifier. The resource name of the ad asset.
    "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
      "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
    },
  },
}

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

Returns:
  An object of the form:

    { # A single ad asset.
  "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
  "adAssetType": "A String", # Required. The type of the ad asset.
  "entityStatus": "A String", # Output only. The entity status of the ad asset.
  "name": "A String", # Identifier. The resource name of the ad asset.
  "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
    "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
  },
}
get(advertiserId, adAssetId, x__xgafv=None)
Gets an ad asset. Only supports the retrieval of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

Args:
  advertiserId: string, Required. The ID of the advertiser this ad asset belongs to. (required)
  adAssetId: string, Required. The ID of the ad asset to fetch. Only supports assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A single ad asset.
  "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
  "adAssetType": "A String", # Required. The type of the ad asset.
  "entityStatus": "A String", # Output only. The entity status of the ad asset.
  "name": "A String", # Identifier. The resource name of the ad asset.
  "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
    "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
  },
}
list(advertiserId, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists ad assets under an advertiser ID. Only supports the retrieval of assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`.

Args:
  advertiserId: string, Required. The ID of the advertiser the ad assets belong to. (required)
  filter: string, Optional. Allows filtering of the results by ad asset fields. Supported syntax: * A restriction has the form of `{field} {operator} {value}`. * All fields must use the `EQUALS (=)` operator. Supported fields: * `youtubeVideoAsset.youtubeVideoId` * `entityStatus` Examples: * All active YouTube video ad assets under an advertiser: `entityStatus=ENTITY_STATUS_ACTIVE`
  orderBy: string, Optional. Field by which to sort the list. Acceptable values are: * `entityStatus` * `youtubeVideoAsset.youtubeVideoId` * `adAssetId` (default) The default sorting order is ascending. To specify descending order for a field, a suffix "desc" should be added to the field name. Example: `adAssetId desc`.
  pageSize: integer, Optional. Requested page size. Must be between `1` and `5000`. If unspecified will default to `5000`. Returns error code `INVALID_ARGUMENT` if an invalid value is specified.
  pageToken: string, Optional. A token identifying a page of results the server should return. Typically, this is the value of next_page_token returned from the previous call to `ListAdAssets` method. If not specified, the first page of results will be returned.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A response message for ListAdAssets.
  "adAssets": [ # The list of ad assets. The list will only contain assets of AdAssetType `AD_ASSET_TYPE_YOUTUBE_VIDEO`. This list will be absent if empty.
    { # A single ad asset.
      "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
      "adAssetType": "A String", # Required. The type of the ad asset.
      "entityStatus": "A String", # Output only. The entity status of the ad asset.
      "name": "A String", # Identifier. The resource name of the ad asset.
      "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
        "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
      },
    },
  ],
  "nextPageToken": "A String", # A token to retrieve the next page of results. Pass this value in the page_token field in the subsequent call to `ListAdAssets` method to retrieve the next page of results.
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.
        
upload(advertiserId, body=None, media_body=None, media_mime_type=None, x__xgafv=None)
Uploads and creates an ad asset. Returns the ID of the newly-created ad asset if successful. Only supports the uploading of assets with the AdAssetType `AD_ASSET_TYPE_IMAGE`.

Args:
  advertiserId: string, Required. The ID of the advertiser this ad asset belongs to. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request message for UploadAdAsset.
  "adAssetType": "A String", # Required. The type of the ad asset. Only `AD_ASSET_TYPE_IMAGE` is supported.
  "filename": "A String", # Required. The filename of the ad asset, including the file extension. The filename must be UTF-8 encoded with a maximum size of 240 bytes.
}

  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A response message for UploadAdAsset.
  "adAsset": { # A single ad asset. # The created ad asset.
    "adAssetId": "A String", # Output only. The ID of the ad asset. Referred to as the asset ID when assigned to an ad.
    "adAssetType": "A String", # Required. The type of the ad asset.
    "entityStatus": "A String", # Output only. The entity status of the ad asset.
    "name": "A String", # Identifier. The resource name of the ad asset.
    "youtubeVideoAsset": { # Data for a YouTube video ad asset. # Youtube video asset data.
      "youtubeVideoId": "A String", # Required. The YouTube video id of the asset. This is the 11 char string value used in the YouTube video URL.
    },
  },
}