0

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


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);



by
0 Replies
This forum is locked.

Recent Posts

in General - APT