Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomDateRangeStart error #194

Open
janiskelemen opened this issue Nov 15, 2023 · 0 comments
Open

CustomDateRangeStart error #194

janiskelemen opened this issue Nov 15, 2023 · 0 comments

Comments

@janiskelemen
Copy link

Hi,

I'm getting an error when I use the CustomDateRangeStart and CustomDateRangeEnd properties.

Fault Code: a:DeserializationFailed Fault String: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/Reporting/v13:ReportRequest. The InnerException message was 'Error in line 2 position 4777. 'EndElement' 'CustomDateRangeStart' from namespace 'https://bingads.microsoft.com/Reporting/v13' is not expected. Expecting element 'Day'.'. Please see InnerException for more details. Fault Detail:

        $report = new AdGroupPerformanceReportRequest();

        $report->Format = ReportFormat::Csv;
        $report->ReportName = 'Ad Group Performance Report';
        $report->ReturnOnlyCompleteData = false;
        $report->Aggregation = ReportAggregation::Daily;

        $report->Scope = new AccountThroughAdGroupReportScope();
        if(!empty($campaigns) && $campaigns[0]['CampaignId'] != null) {
            $report->Scope->Campaigns = $campaigns;
        } else {
            $report->Scope->AccountIds = $accountIds;
        }

        $report->Time = new ReportTime();
        $report->Time->ReportTimeZone = 'AmsterdamBerlinBernRomeStockholmVienna';
         $date = new Date();
         $date->Day = 7;
         $date->Month = 11;
         $date->Year = 2023;
         $report->Time->CustomDateRangeStart = $date;
         $report->Time->CustomDateRangeEnd = $date;

        .......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant