locked
Getting errors on AddTarget Call RRS feed

  • Question

  • Hello,

    I was trying to add Metroarea target to my adgroup and I got this error.
    "Operation error 1410 encountered. The metro area target specified is a duplicate." and
    the TrackingId was  2c2c5a19-72c1-483f-811a-e4b1e4143cfc.

    So I tried to add just one Metroarea and this time I got another error saying
    "Operation error 1405 encountered. The location target specified is invalid. "
    with a TrackingId =69f76038-f2f3-433b-9a83-a6b1342f8d34

    Does anyone know why I am getting duplicate metroarea and invalid location target errors.
    Please see the code below for the input values.

    Thanks


    I am using PHP and Soap and here is my input code.
    wsdl is https://adcenterapi.microsoft.com/api/advertiser/v5/CampaignManagement/CampaignManagementService.svc?wsdl


              //MetroArea 864414060903399424 - Kenai, Alaska
                $locationTargetBidArray[] = array(
                  "IncrementalBid" => 'TenPercent',
                  "MetroAreaId" => '864414060903399424'
                );
               
                //MetroArea 864414060752404480 - Juneau, Alaska
                $locationTargetBidArray[] = array(
                   "IncrementalBid" => 'TwentyPercent',
                    "MetroAreaId" => '864414060752404480'
                );
               
                //MetroArea 864415155834847232 - Decatur,Alabama
                $locationTargetBidArray[] = array(
                   "IncrementalBid" => 'TwentyPercent',
                    "MetroAreaId" => '864415155834847232'
                 );
               
               
                 // Assign the age target details
                 // array to an ageTarget variable.
                 $metroTarget = array
                 (
                     "Bids" => $locationTargetBidArray,
                     "TargetAllMetroAreas"=>"true"
                 );
                              
                 $metroareatarget = array
                 (
                     "MetroAreaTarget" => $metroTarget    
                 );
                          
                 // Assign the $metroareatarget variable to
                 // a target variable.
                 $target = array
                 (
                     "Location" => $metroareatarget
                 );


         // Specify the parameters for the SOAP call.
        $params = array
        (
            'AdGroupId'=>$adGroupId,
            'Target'=>$target
        );

        // Execute the SOAP call.
        $result = $client->__soapCall
        (
            $action,
            array( $action.'Request' => $params ),
            null,
            $inputHeaders,
            $outputHeaders
        );
           
    Friday, June 20, 2008 3:03 PM

Answers

  • Hi Sarah,

     

    Removing the quotes around the MetroAreaId numeric values should allow the code to succeed.

     

    That is, try changing the assignments in the form

     

    "MetroAreaId" => '864414060903399424'

     

    to

     

    "MetroAreaId" => 864414060903399424

     

    Please advise as to whether that solves the issue.

     

    Thank you.

     

    Walter Poupore
    Lead Programming Writer
    Microsoft adCenter API

    Saturday, June 21, 2008 12:06 AM