BingAds / BingAds-PHP-SDK

Other
56 stars 46 forks source link

i am getting an error using GetKeywordTrafficEstimatesRequest #25

Closed asmagillani closed 7 years ago

asmagillani commented 7 years ago

Hi, I am facing this problem i have follow the documentation for GetKeywordTrafficEstimatesRequest

SoapFault {#516 ▼

message: "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 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."

code: 0

file: "D:\xampp\htdocs\stagging-odn\app\Services\BingBudgetService.php"

line: 387

+"faultstring": "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 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." +"faultcode": "a:InternalServiceFault"

} and my code is

$proxy = new ServiceClient(ServiceClientType::AdInsightVersion11, $AuthorizationData, AuthHelper::GetApiEnvironment()); $campaignproxy = new ServiceClient(ServiceClientType::CampaignManagementVersion11, $AuthorizationData, AuthHelper::GetApiEnvironment()); //dd($proxy);

        $KeywordEstimator = new KeywordEstimator();
        $keyword = new Keyword();

        $keyword->MatchType = MatchType::Broad;
        $keyword->Text = "Web design";
        $KeywordEstimator->Keyword = $keyword;

        $adgroupEstimatores[] = $KeywordEstimator;
        $adgroupEstimatore = new AdGroupEstimator();
        $adgroupEstimatore->KeywordEstimators = [$KeywordEstimator];
        $adgroupEstimatore->MaxCpc = 1;
        $campaignEstimator = new CampaignEstimator();
        $campaignEstimator->AdGroupEstimators = [$adgroupEstimatore];
       // dd($campaignEstimator);
        $locationCriterian = new LocationCriterion();
        $locationCriterian->LocationId = 190;
        $languageCriterian = new LanguageCriterion();
        $languageCriterian->Language="English";

        $campaignEstimator->Criteria = [$locationCriterian, $languageCriterian];

        $trafficEstimator = new GetKeywordTrafficEstimatesRequest();
        $trafficEstimator->CampaignEstimators = [$campaignEstimator];
       // dd($trafficEstimator);
        $data =  $proxy->GetService()->GetKeywordTrafficEstimates($trafficEstimator);
        dd($data);

tell me where i am wrong and why i am getting this error

Thanks

eric-urban commented 7 years ago

Thanks for the request, and we've added a new KeywordPlanner sample. I hope this helps!

asmagillani commented 7 years ago

Thanks Eric it was quite helping for me

Regards

On Fri, Sep 15, 2017 at 4:57 AM, Eric Urban notifications@github.com wrote:

Closed #25 https://github.com/BingAds/BingAds-PHP-SDK/issues/25.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BingAds/BingAds-PHP-SDK/issues/25#event-1250214216, or mute the thread https://github.com/notifications/unsubscribe-auth/ARurxWdo8WfmrKQvHX81oqw-KcqQmPNVks5sib1NgaJpZM4PPT8w .