tmarois / laravel-ads-sdk

PHP SDK for Google Ads, Bing Ads, and Facebook Ads API for Laravel
MIT License
110 stars 42 forks source link

Bing Ads: Invalid client data #54

Open zacksmash opened 2 years ago

zacksmash commented 2 years ago

I'm using the Bing Ads service, with the getCampaignReport() method, and I keep getting this error:

Invalid client data. Check the SOAP fault details for more information. TrackingId: some-uuid-xxx

Here's my query:

$response = LaravelAds::bingAds()
    ->with($this->client->bing_ads_id) // I've verified I'm using the correct Bing AID
    ->reports($this->dates[0], $this->dates[1]) // The dates are well formatted: yyyy-mm-dd
    ->setFields([
        CampaignPerformanceReportColumn::TimePeriod,
        CampaignPerformanceReportColumn::AccountId,
        CampaignPerformanceReportColumn::CampaignName,
        CampaignPerformanceReportColumn::CampaignId,
        CampaignPerformanceReportColumn::CampaignType,
        CampaignPerformanceReportColumn::Impressions,
        CampaignPerformanceReportColumn::Clicks,
        CampaignPerformanceReportColumn::Conversions,
        CampaignPerformanceReportColumn::Ctr,
        CampaignPerformanceReportColumn::AverageCpc,
        CampaignPerformanceReportColumn::Spend,
    ])
    ->getCampaignReport();

I've double checked my credentials and even generated new ones to be absolutely sure. I've request a new access token, using the artisan command provided. Any ideas what could the issue?

webmid commented 1 year ago

@timothymarois I have same issue!

webmid commented 1 year ago

Hi again. I found the issue. You should change the scope and update Microsoft Bing package to last version You must update your application to get user consent using the new msads.manage scope. All application developers must take action to use the new scope. for more information read this document: Document

BaukeBoorsma commented 1 year ago

@webmid Thanks for pointing me in the right direction with your comment. My credentials expired yesterday and I couldn't get them renewed, even when manually changing the url to have the new scopes and enabling MFA on my account (Bing docs said MFA was now also mandatory). Updating laravel-ads to dev-master, solved it.

zacksmash commented 1 year ago

@webmid How did you change the scope?

webmid commented 1 year ago

@zacksmash

You can see my changes here:

https://github.com/tmarois/laravel-ads-sdk/commit/04021abb4163affaa70be1fcc7f931bab9e9cb71

zacksmash commented 1 year ago

@webmid That's helpful, thank you!

Do we have an estimate on when this will be incorporated into the package, and released? @timothymarois