Hello
I did some changes to APT PHP Sample Code , added addInventoryIdentifier function and i called it from demoPublisher function
When tried to add AdSize to a website using addInventoryIdentifier method, the service returns error message says: Insufficient Parameters, despite sending all parameters described in yahoo apt service overview and apt api reference.
Please help me to find the error, here is the php code:
CODE
<?php
function addInventoryIdentifier($publisherAccountID, $accountLocation,$siteID) {
$inventoryData['name']="My Inv";
$inventoryData['siteID']=$siteID;
$targetingAttributeDescriptors = array();
$targetingService = self::createClient("TargetingDictionaryService", $publisherAccountID, $accountLocation);
$response = self::execute($targetingService, "getTargetingAttributesByValue",array('targetingAttributeType'=>'AdSize','value'=>'468x60'));
$adSizeAttr = $response->out->TargetingAttributeValue;
$adSizeDescriptors['targetingAttributeID'] = $adSizeAttr->ID;
$adSizeDescriptors['targetingAttributeType'] = $adSizeAttr->type;
$inventoryData['targetingAttributeDescriptors'][0]=$adSizeDescriptors;
$inventoryService = createClient("InventoryIdentifierService", $publisherAccountID, $accountLocation);
$response = execute($inventoryService, "addInventoryIdentifier",array('inventoryIdentifier'=>$inventoryData));
}
?>