Yahoo APT InventorySearchService: Can not search inventory on Yahoo! Ad network

ashwin9 Sep 2011 9:28 AM


We are trying to serach inventory using InventorySearchService using InventorySearchService.searchInventoryByInventorySearchRequests(reqArr); API

When we set PlacementTarget

Placement.contentTargetingAttributes.placementTarget.ID = "12334" // Our won account ID
Placement.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;

serach works fine but it only searches inventory on our won network.

We want to search inventory on "Yahoo! Ad Network", Id for this network is   "0" that we get from  API
aptClient.AccountService.searchForAccount(SearchAccountType.Network, true, "yahoo", 0, 5);

When we set following values to placement

Placement.contentTargetingAttributes.placementTarget.ID = "0" // Our won account ID
Placement.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;

It give error "E3906 : Placement update is not allowed for field {0}." while calling InventorySearchService.searchInventoryByInventorySearchRequests(reqArr); API.

Can anybody help on how to search inventory on networks other than you won.

We are usinig following code

See the line in red below

   aptClient = new YahooAPTClient(username, password, license, _defaultAdvertiserAcctId, endPoint, version);
    Placement pc = new Placement();
    pc.adAttributes = new AdAttributes();

    pc.adAttributes.adSizeIDs = new long?[] { 2077501 }; // 300 x 250//2077501 // parent 2077001
    pc.adAttributes.adFormatID = 2074501; //2074501
    pc.adAttributes.adFormatIDSpecified = true;


    pc.startDate = DateTime.UtcNow.AddDays(1);
    pc.endDate = DateTime.UtcNow.Date.AddDays(3).AddTicks(-1);
    pc.endDateSpecified = true;
    pc.startDateSpecified = true;

    pc.contentTargetingAttributes = new ContentTargetingAttributes();
    pc.contentTargetingAttributes.placementTarget = new PlacementTarget();
   
  pc.contentTargetingAttributes.placementTarget.ID = "0";// _ownAccID;  When set to our own account iD works fine.
   // when set to "0" for Yahoo! Ad Network give error   "E3906 : Placement update is not allowed for field {0}." 


    pc.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;
    pc.contentTargetingAttributes.placementTarget.typeSpecified = true;
    pc.isRequiredPlacement = false;
    pc.isRequiredPlacementSpecified = true;

   

    pc.guaranteedPriceSettings = new PlacementGuaranteedPriceSettings();
    pc.guaranteedPriceSettings.deliveryModel = DeliveryModel.Impressions;

    pc.guaranteedPriceSettings.deliveryModelSpecified = true;
    //The RevenueModel must be InternalBarter for an internal order.
    pc.guaranteedPriceSettings.revenueModel = RevenueModel.NotApplicable;
    pc.guaranteedPriceSettings.revenueModelSpecified = true;

    pc.guaranteedPriceSettings.pricingType = PricingType.CPM;
    pc.guaranteedPriceSettings.pricingTypeSpecified = true;
    pc.guaranteedPriceSettings.price = 0;
    pc.guaranteedPriceSettings.priceSpecified = true;


    InventorySearchRequest request = new InventorySearchRequest()
    {
    placement = pc,
    };

    InventorySearchRequest[] reqArr = new InventorySearchRequest[1];

    reqArr[0] = request;

    InventorySearchResponse[] inv = aptClient.InventorySearchService.searchInventoryByInventorySearchRequests(reqArr);



Butai12 Oct 2011 12:27 AM
Hi Ashwin<br><br>I am stuck in the same issue...think Yahoo guys will release this facility in their next release<br><br><div class="quote"><div class="quotetop">QUOTE<cite>(ashwin @ 9 Sep 2011 9:28 AM)</cite></div><blockquote class="quotemain"><p><br>We are trying to serach inventory using InventorySearchService using InventorySearchService.searchInventoryByInventorySearchRequests(reqArr); API<br><br>When we set PlacementTarget <br><br>Placement.contentTargetingAttributes.placementTarget.ID = &quot;12334&quot; // Our won account ID<br>Placement.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;<br><br>serach works fine but it only searches inventory on our won network. <br><br>We want to search inventory on &quot;Yahoo! Ad Network&quot;, Id for this network is&nbsp;&nbsp; &quot;0&quot; that we get from&nbsp; API <br>aptClient.AccountService.searchForAccount(SearchAccountType.Network, true, &quot;yahoo&quot;, 0, 5);<br><br>When we set following values to placement <br><br>Placement.contentTargetingAttributes.placementTarget.ID =&nbsp;&quot;0&quot; // Our won account ID<br>Placement.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;<br><br>It give error <font style="BACKGROUND-COLOR:#ff0000;">&quot;E3906 : Placement update is not allowed for field {0}.&quot;</font>&nbsp;while calling InventorySearchService.searchInventoryByInventorySearchRequests(reqArr); API.<br><br>Can anybody help on how to search inventory on networks other than you won.<br><br>We are usinig following code<br><br><font style="BACKGROUND-COLOR:#ff0000;">See the line in red below</font><br><br>&nbsp;&nbsp;&nbsp;aptClient = new YahooAPTClient(username, password, license, _defaultAdvertiserAcctId, endPoint, version);<br>&nbsp;&nbsp;&nbsp; Placement pc = new Placement();<br>&nbsp;&nbsp;&nbsp; pc.adAttributes = new AdAttributes();</p><p>&nbsp;&nbsp;&nbsp; pc.adAttributes.adSizeIDs = new long?[] { 2077501 }; // 300 x 250//2077501 // parent 2077001<br>&nbsp;&nbsp;&nbsp; pc.adAttributes.adFormatID = 2074501; //2074501<br>&nbsp;&nbsp;&nbsp; pc.adAttributes.adFormatIDSpecified = true;</p><p><br>&nbsp;&nbsp;&nbsp; pc.startDate = DateTime.UtcNow.AddDays(1);<br>&nbsp;&nbsp;&nbsp; pc.endDate = DateTime.UtcNow.Date.AddDays(3).AddTicks(-1);<br>&nbsp;&nbsp;&nbsp; pc.endDateSpecified = true;<br>&nbsp;&nbsp;&nbsp; pc.startDateSpecified = true;</p><p>&nbsp;&nbsp;&nbsp; pc.contentTargetingAttributes = new ContentTargetingAttributes();<br>&nbsp;&nbsp;&nbsp; pc.contentTargetingAttributes.placementTarget = new PlacementTarget();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp; <font style="BACKGROUND-COLOR:#ff0000;">pc.contentTargetingAttributes.placementTarget.ID = &quot;0&quot;;// _ownAccID;&nbsp; When set to our&nbsp;own account iD works fine.<br>&nbsp;&nbsp;&nbsp;// when set to &quot;0&quot; for Yahoo! Ad&nbsp;Network give error&nbsp;&nbsp; <font style="BACKGROUND-COLOR:#ff0000;">&quot;E3906 : Placement update is not allowed for field {0}.&quot;</font>&nbsp;<br></font><br><br>&nbsp;&nbsp;&nbsp; pc.contentTargetingAttributes.placementTarget.type = PlacementTargetType.Network;<br>&nbsp;&nbsp;&nbsp; pc.contentTargetingAttributes.placementTarget.typeSpecified = true;<br>&nbsp;&nbsp;&nbsp; pc.isRequiredPlacement = false;<br>&nbsp;&nbsp;&nbsp; pc.isRequiredPlacementSpecified = true;<br><br>&nbsp;&nbsp;&nbsp;</p><p>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings = new PlacementGuaranteedPriceSettings();<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.deliveryModel = DeliveryModel.Impressions;</p><p>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.deliveryModelSpecified = true;<br>&nbsp;&nbsp;&nbsp; //The RevenueModel must be InternalBarter for an internal order.<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.revenueModel = RevenueModel.NotApplicable;<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.revenueModelSpecified = true;</p><p>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.pricingType = PricingType.CPM;<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.pricingTypeSpecified = true;<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.price = 0;<br>&nbsp;&nbsp;&nbsp; pc.guaranteedPriceSettings.priceSpecified = true;</p><p><br>&nbsp;&nbsp;&nbsp; InventorySearchRequest request = new InventorySearchRequest()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; placement = pc,<br>&nbsp;&nbsp;&nbsp; };</p><p>&nbsp;&nbsp;&nbsp; InventorySearchRequest[] reqArr = new InventorySearchRequest[1];</p><p>&nbsp;&nbsp;&nbsp; reqArr[0] = request;</p><p>&nbsp;&nbsp;&nbsp; InventorySearchResponse[] inv = aptClient.InventorySearchService.searchInventoryByInventorySearchRequests(reqArr);<br><br><br><br></p></blockquote></div>