Mike1020 Posted March 8, 2020 Share Posted March 8, 2020 (edited) Hi, I am attempting to download a report from Bing Ads, and am having issues with the level of nesting on the SOAP request for the date, (specifically 'Time' = >....) Definitely appreciate the help! SOAP elements can be found at https://docs.microsoft.com/en-us/advertising/reporting-service/date?view=bingads-13 for date and https://docs.microsoft.com/en-us/advertising/reporting-service/reporttime?view=bingads-13 using CustomDateRangeStart and CustomDateRangeEnd $request = [ 'ReportRequest' => new SoapVar( [ 'Format' => 'Csv', 'ReportName' => 'Bing Keyword Performance Report', 'ReturnOnlyCompleteData' => false, 'Aggregation' => 'Daily', 'Sort' => ['SortColumn' => 'Clicks'], 'Sort' => ['SortOrder' => 'Ascending'], 'Scope' => [['AccountIds' => [...]], ['CampaignId' => null], ['AdGroupId' => [...]]], 'Time' => ['CustomDateRangeStart' => ['Date' => ['Day' => $startDay],['Month' => $startMonth],['Year' => $startYear]]], 'Time' => ['CustomDateRangeEnd' => ['Date' => ['Day' => $endDay],['Month' => $endMonth],['Year' => $endYear]]], 'Filter' => ['BidMatchType' => [$mt]], 'Keywords' => array($criteriaValue), 'Columns' => [ "TimePeriod", "Spend", "Clicks", "CurrentMaxCpc", "Impressions", "AverageCpc", "TopVsOther", "QualityScore", "CampaignStatus", "AdGroupStatus", "BidMatchType", "AdGroupName" ] ], SOAP_ENC_OBJECT, 'KeywordPerformanceReportRequest', "https://bingads.microsoft.com/Reporting/v13" )]; Edited March 8, 2020 by Mike1020 Added a link for ReportTime data object Quote Link to comment Share on other sites More sharing options...
requinix Posted March 8, 2020 Share Posted March 8, 2020 A soap "sequence" doesn't mean a collection of things. It means that the child elements are present and in the order given. So Date should be a single thing containing a Day, Month, and Year. Quote Link to comment Share on other sites More sharing options...
Mike1020 Posted March 8, 2020 Author Share Posted March 8, 2020 Thank you for your help! Working result is: 'Time' => [ 'CustomDateRangeStart' => ['Day' => $startDay,'Month' => $startMonth,'Year' => $startYear], 'CustomDateRangeEnd' => ['Day' => $endDay,'Month' => $endMonth,'Year' => $endYear] ], Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.