0

I am trying to create an HTML5 (CREATIVE_TYPE_STANDARD) creative in DV360 by calling the C# API.

Here is the code for initializing a Creative object:

var mainAsset = new AssetAssociation { Asset = new Asset { MediaId = mediaId }, Role = "ASSET_ROLE_MAIN" };
var exitEvent = new ExitEvent { Type = "EXIT_EVENT_TYPE_DEFAULT", Url = exitUrl, Name = "EXIT_EVENT" };
var timerEvent = new TimerEvent { Name = "tick", ReportingName = "tick" };
var creative = new Creative
{
    DisplayName = displayName,
    EntityStatus = "ENTITY_STATUS_ACTIVE",
    HostingSource = "HOSTING_SOURCE_HOSTED",
    CreativeType = "CREATIVE_TYPE_STANDARD",

    Dimensions = new Dimensions { HeightPixels = heightPixels, WidthPixels = widthPixels },
    Assets = new List<AssetAssociation>
    {
        mainAsset
    },
    ExitEvents = new List<ExitEvent> { exitEvent },
    TimerEvents = new List<TimerEvent> { timerEvent }
};

I am calling the API as follows (in my opinion the API call itself is not the problem because it has worked for another type of creative):

var request = displayVideoService.Advertisers.Creatives.Create(creative, advertiserId);
await request.ExecuteAsync()

This is the error I am getting:

CREATIVE_CUSTOM_EVENT_NAME_REQUIRED: A name is required for custom events. [400]
Errors [
    Message[CREATIVE_CUSTOM_EVENT_NAME_REQUIRED: A name is required for custom events.] Location[ - ] Reason[badRequest] Domain[global]
]

I am not sure what is meant by "custom events". In the documentation "custom events" are mentioned only in reference to TimerEvents. That is why I tried setting the TimerEvents property. I am not sure what values to assign to TimerEvent.Name (set to tick at the moment) and if it is in fact the property that the API is complaining about.

I would like to see if anyone has encountered this error before and would be able to provide more clarity about it.

Developer
  • 435
  • 4
  • 16

1 Answers1

0

The problem was not caused by the C# code as I initially thought. Sorry for the confusion.

The problem was caused by the JavaScript code in one of the assets using the Google Studio Enabler library. Google Studio functionality is not supported when creating creatives directly in DV360 using the API. Hence the Enabler library is not supported either. By using plain JavaScript in our assets we managed to upload the assets and create a creative via the API. In Google terminology, this kind of HTML5 creative is a "display creative" whereas a creative created by using Google Studio is a "rich media creative".

Developer
  • 435
  • 4
  • 16