PHP bing ads ad insight report error

Oriol Camps 0 Reputation points
2024-05-15T09:14:34.2333333+00:00

Hi,

I'm trying to fetch the Auction insights data using the PHP client library. I've succesfully fetched other reports and metrics but I can't fetch the insights. Here's the code snippet I'm using:

// .... code above

$startDate = new DayMonthAndYear();
$startDate->Day = 1;
$startDate->Month = 5;
$startDate->Year = 2024;
$endDate = (clone $startDate);
$endDate->Day = 10;

$dateSearch = new DateRangeSearchParameter();
$dateSearch->StartDate = $startDate;
$dateSearch->EndDate = $endDate;

$auctionSegments = new AuctionSegmentSearchParameter();
$auctionSegments->Segment = 'Day';

$report = new GetAuctionInsightDataRequest();
$report->EntityType = EntityType::Account;
$report->EntityIds = [....]; // Removed for privacy... The ads account ID, just one
$report->SearchParameters = [
   $dateSearch,
   $auctionSegments,
];

// The serviceClient has been fetched before, this is just the snippet for the request
$response = $serviceClient->GetService()->GetAuctionInsightData($report); // CRASH HERE

dump($response);

And the response/error:

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.

Am I doing something wrong? I can't seem to get any more detailed errors.

Thanks.

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
394 questions
0 comments No comments
{count} votes