Skip to content

Commit df8f191

Browse files
authored
Merge pull request #89 from BingAds/v12-0-1
sunset version 11 and refresh version 12
2 parents b347fcb + b758de4 commit df8f191

File tree

927 files changed

+1138
-32533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

927 files changed

+1138
-32533
lines changed

samples/V12/AuthHelper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static function AuthenticateWithOAuth()
122122
$authentication = (new OAuthDesktopMobileAuthCodeGrant())
123123
->withEnvironment(AuthHelper::ApiEnvironment)
124124
->withClientId(AuthHelper::ClientId);
125-
125+
126126
$GLOBALS['AuthorizationData'] = (new AuthorizationData())
127127
->withAuthentication($authentication)
128128
->withDeveloperToken(AuthHelper::DeveloperToken);
@@ -139,8 +139,7 @@ static function AuthenticateWithOAuth()
139139
else
140140
{
141141
AuthHelper::RequestUserConsent();
142-
}
143-
142+
}
144143
}
145144
catch(OAuthTokenRequestException $e)
146145
{

samples/V12/BudgetOpportunities.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
// Specify the Microsoft\BingAds\V12\CampaignManagement classes that will be used.
2828
use Microsoft\BingAds\V12\CampaignManagement\CampaignType;
29+
use Microsoft\BingAds\V12\CampaignManagement\CampaignAdditionalField;
2930

3031
$GLOBALS['AuthorizationData'] = null;
3132
$GLOBALS['Proxy'] = null;
@@ -55,7 +56,9 @@
5556

5657
$getCampaignsByAccountIdResponse = CampaignManagementExampleHelper::GetCampaignsByAccountId(
5758
$GLOBALS['AuthorizationData']->AccountId,
58-
AuthHelper::CampaignTypes);
59+
AuthHelper::CampaignTypes,
60+
CampaignAdditionalField::ExperimentId
61+
);
5962

6063
if(isset($getCampaignsByAccountIdResponse->Campaigns))
6164
{

samples/V12/CampaignManagementExampleHelper.php

Lines changed: 276 additions & 3 deletions
Large diffs are not rendered by default.

samples/V12/KeywordsAds.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Microsoft\BingAds\V12\CampaignManagement\Ad;
2525
use Microsoft\BingAds\V12\CampaignManagement\AdType;
2626
use Microsoft\BingAds\V12\CampaignManagement\AdAdditionalField;
27+
use Microsoft\BingAds\V12\CampaignManagement\CampaignAdditionalField;
2728
use Microsoft\BingAds\V12\CampaignManagement\ExpandedTextAd;
2829
use Microsoft\BingAds\V12\CampaignManagement\Bid;
2930
use Microsoft\BingAds\V12\CampaignManagement\BiddingScheme;
@@ -312,7 +313,9 @@
312313

313314
$getCampaigns = CampaignManagementExampleHelper::GetCampaignsByAccountId(
314315
$GLOBALS['AuthorizationData']->AccountId,
315-
AuthHelper::CampaignTypes)->Campaigns;
316+
AuthHelper::CampaignTypes,
317+
CampaignAdditionalField::ExperimentId
318+
)->Campaigns;
316319

317320
$updateCampaigns = array();
318321
$updateBudgets = array();
@@ -424,7 +427,9 @@
424427
$getCampaigns = CampaignManagementExampleHelper::GetCampaignsByIds(
425428
$GLOBALS['AuthorizationData']->AccountId,
426429
$getCampaignIds,
427-
AuthHelper::CampaignTypes)->Campaigns;
430+
AuthHelper::CampaignTypes,
431+
CampaignAdditionalField::ExperimentId
432+
)->Campaigns;
428433

429434
print("List of campaigns AFTER update:\n");
430435
foreach ($getCampaigns->Campaign as $campaign)
@@ -477,6 +482,7 @@
477482
$nillableAdGroupIds->long[0],
478483
$adTypes,
479484
$adAdditionalFields);
485+
480486
if(isset($ads->Ads)){
481487
CampaignManagementExampleHelper::OutputArrayOfAd($ads->Ads);
482488
}

samples/V12/SearchUserAccounts.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Microsoft\BingAds\V12\CampaignManagement\GetCampaignsByAccountIdRequest;
2121
use Microsoft\BingAds\V12\CampaignManagement\Campaign;
2222
use Microsoft\BingAds\V12\CampaignManagement\CampaignType;
23+
use Microsoft\BingAds\V12\CampaignManagement\CampaignAdditionalField;
2324

2425
// Specify the Microsoft\BingAds\V12\CustomerManagement classes that will be used.
2526
use Microsoft\BingAds\V12\CustomerManagement\Paging;
@@ -96,7 +97,9 @@
9697
CustomerManagementExampleHelper::OutputArrayOfInt($featurePilotFlags);
9798
$getCampaignsByAccountIdResponse = CampaignManagementExampleHelper::GetCampaignsByAccountId(
9899
$account->Id,
99-
AuthHelper::CampaignTypes);
100+
AuthHelper::CampaignTypes,
101+
CampaignAdditionalField::ExperimentId
102+
);
100103
CampaignManagementExampleHelper::OutputArrayOfCampaign($getCampaignsByAccountIdResponse->Campaigns);
101104
}
102105
}

samples/V12/TargetCriterions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use Microsoft\BingAds\V12\CampaignManagement\BudgetLimitType;
3434
use Microsoft\BingAds\V12\CampaignManagement\Bid;
3535
use Microsoft\BingAds\V12\CampaignManagement\Date;
36+
use Microsoft\BingAds\V12\CampaignManagement\CampaignAdditionalField;
3637

3738
// Specify the Microsoft\BingAds\Auth classes that will be used.
3839
use Microsoft\BingAds\Auth\ServiceClient;
@@ -70,7 +71,9 @@
7071
$getCampaigns = CampaignManagementExampleHelper::GetCampaignsByIds(
7172
$GLOBALS['AuthorizationData']->AccountId,
7273
$campaignIds,
73-
AuthHelper::CampaignTypes)->Campaigns;
74+
AuthHelper::CampaignTypes,
75+
CampaignAdditionalField::ExperimentId
76+
)->Campaigns;
7477

7578
// Loop through all campaigns and ad groups to get the target criterion IDs.
7679

src/Auth/LiveComOAuthService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public function GetAccessTokens(OAuthRequestParameters $oauthRequestParameters,
8989
return (new OAuthTokens())
9090
->withAccessToken($accessToken)
9191
->withAccessTokenExpiresInSeconds($expiresIn)
92-
->withRefreshToken($refreshToken);
92+
->withRefreshToken($refreshToken)
93+
->withResponseFragments($responseArray);
9394
}
9495
else if(isset($responseArray['error']))
9596
{

src/Auth/OAuthTokens.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ class OAuthTokens
2222
*/
2323
public $RefreshToken;
2424

25+
/**
26+
* Represents the full set of fragments returned from the authorization service
27+
* in resposne to an access token request.
28+
*/
29+
public $ResponseFragments;
30+
2531
public function __construct() {}
2632

2733
/**
@@ -47,4 +53,12 @@ public function withRefreshToken($refreshToken) {
4753
$this->RefreshToken = $refreshToken;
4854
return $this;
4955
}
56+
57+
/**
58+
* Includes the response fragments.
59+
*/
60+
public function withResponseFragments($responseFragments) {
61+
$this->ResponseFragments = $responseFragments;
62+
return $this;
63+
}
5064
}

src/Auth/ServiceClient.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
use Microsoft\BingAds\V12\CustomerManagement\CustomerManagementServiceSettings as CustomerManagementServiceSettingsVersion12;
1010
use Microsoft\BingAds\V12\Reporting\ReportingServiceSettings as ReportingServiceSettingsVersion12;
1111

12-
use Microsoft\BingAds\V11\AdInsight\AdInsightServiceSettings as AdInsightServiceSettingsVersion11;
13-
use Microsoft\BingAds\V11\Bulk\BulkServiceSettings as BulkServiceSettingsVersion11;
14-
use Microsoft\BingAds\V11\CampaignManagement\CampaignManagementServiceSettings as CampaignManagementServiceSettingsVersion11;
15-
use Microsoft\BingAds\V11\CustomerBilling\CustomerBillingServiceSettings as CustomerBillingServiceSettingsVersion11;
16-
use Microsoft\BingAds\V11\CustomerManagement\CustomerManagementServiceSettings as CustomerManagementServiceSettingsVersion11;
17-
use Microsoft\BingAds\V11\Reporting\ReportingServiceSettings as ReportingServiceSettingsVersion11;
18-
1912
use \DOMDocument;
2013
use \DOMXPath;
2114
use \SoapHeader;
@@ -45,13 +38,6 @@ class ServiceClient
4538
ServiceClientType::CustomerBillingVersion12 => CustomerBillingServiceSettingsVersion12::SandboxEndpoint,
4639
ServiceClientType::CustomerManagementVersion12 => CustomerManagementServiceSettingsVersion12::SandboxEndpoint,
4740
ServiceClientType::ReportingVersion12 => ReportingServiceSettingsVersion12::SandboxEndpoint,
48-
49-
ServiceClientType::AdInsightVersion11 => AdInsightServiceSettingsVersion11::SandboxEndpoint,
50-
ServiceClientType::BulkVersion11 => BulkServiceSettingsVersion11::SandboxEndpoint,
51-
ServiceClientType::CampaignManagementVersion11 => CampaignManagementServiceSettingsVersion11::SandboxEndpoint,
52-
ServiceClientType::CustomerBillingVersion11 => CustomerBillingServiceSettingsVersion11::SandboxEndpoint,
53-
ServiceClientType::CustomerManagementVersion11 => CustomerManagementServiceSettingsVersion11::SandboxEndpoint,
54-
ServiceClientType::ReportingVersion11 => ReportingServiceSettingsVersion11::SandboxEndpoint
5541
);
5642

5743
private $productionServiceClientEndpoints = array(
@@ -61,13 +47,6 @@ class ServiceClient
6147
ServiceClientType::CustomerBillingVersion12 => CustomerBillingServiceSettingsVersion12::ProductionEndpoint,
6248
ServiceClientType::CustomerManagementVersion12 => CustomerManagementServiceSettingsVersion12::ProductionEndpoint,
6349
ServiceClientType::ReportingVersion12 => ReportingServiceSettingsVersion12::ProductionEndpoint,
64-
65-
ServiceClientType::AdInsightVersion11 => AdInsightServiceSettingsVersion11::ProductionEndpoint,
66-
ServiceClientType::BulkVersion11 => BulkServiceSettingsVersion11::ProductionEndpoint,
67-
ServiceClientType::CampaignManagementVersion11 => CampaignManagementServiceSettingsVersion11::ProductionEndpoint,
68-
ServiceClientType::CustomerBillingVersion11 => CustomerBillingServiceSettingsVersion11::ProductionEndpoint,
69-
ServiceClientType::CustomerManagementVersion11 => CustomerManagementServiceSettingsVersion11::ProductionEndpoint,
70-
ServiceClientType::ReportingVersion11 => ReportingServiceSettingsVersion11::ProductionEndpoint
7150
);
7251

7352
private $serviceClientNamespaces = array(
@@ -77,13 +56,6 @@ class ServiceClient
7756
ServiceClientType::CustomerBillingVersion12 => CustomerBillingServiceSettingsVersion12::ServiceNamespace,
7857
ServiceClientType::CustomerManagementVersion12 => CustomerManagementServiceSettingsVersion12::ServiceNamespace,
7958
ServiceClientType::ReportingVersion12 => ReportingServiceSettingsVersion12::ServiceNamespace,
80-
81-
ServiceClientType::AdInsightVersion11 => AdInsightServiceSettingsVersion11::ServiceNamespace,
82-
ServiceClientType::BulkVersion11 => BulkServiceSettingsVersion11::ServiceNamespace,
83-
ServiceClientType::CampaignManagementVersion11 => CampaignManagementServiceSettingsVersion11::ServiceNamespace,
84-
ServiceClientType::CustomerBillingVersion11 => CustomerBillingServiceSettingsVersion11::ServiceNamespace,
85-
ServiceClientType::CustomerManagementVersion11 => CustomerManagementServiceSettingsVersion11::ServiceNamespace,
86-
ServiceClientType::ReportingVersion11 => ReportingServiceSettingsVersion11::ServiceNamespace
8759
);
8860

8961
/**

src/Auth/ServiceClientType.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,4 @@ final class ServiceClientType {
1313
const CustomerBillingVersion12 = 'CustomerBillingVersion12';
1414
const CustomerManagementVersion12 = 'CustomerManagementVersion12';
1515
const ReportingVersion12 = 'ReportingVersion12';
16-
17-
const AdInsightVersion11 = 'AdInsightVersion11';
18-
const BulkVersion11 = 'BulkVersion11';
19-
const CampaignManagementVersion11 = 'CampaignManagementVersion11';
20-
const CustomerBillingVersion11 = 'CustomerBillingVersion11';
21-
const CustomerManagementVersion11 = 'CustomerManagementVersion11';
22-
const ReportingVersion11 = 'ReportingVersion11';
2316
}

0 commit comments

Comments
 (0)