Skip to content

Commit 78d4c4f

Browse files
author
Eric Urban
authored
Merge pull request #115 from BingAds/v13-0-1
sunset v12 update v13 proxies
2 parents dd1b9db + f078fba commit 78d4c4f

File tree

904 files changed

+225
-33835
lines changed

Some content is hidden

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

904 files changed

+225
-33835
lines changed

composer.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"ext-openssl": "*",
1212
"ext-soap": "*"
1313
},
14-
"require-dev": {
15-
"ext-curl": "*",
16-
"ext-openssl": "*",
17-
"ext-soap": "*"
18-
},
1914
"autoload": {
2015
"psr-4": {
2116
"Microsoft\\BingAds\\": "/src/"

samples/V13/AdExtensions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@
380380
$adExtensions = CampaignManagementExampleHelper::GetAdExtensionsByIds(
381381
$GLOBALS['AuthorizationData']->AccountId,
382382
$adExtensionIds,
383-
$adExtensionsTypeFilter
383+
$adExtensionsTypeFilter,
384+
null
384385
)->AdExtensions;
385386
print("AdExtensions:\r\n");
386387
CampaignManagementExampleHelper::OutputArrayOfAdExtension($adExtensions);
@@ -426,7 +427,8 @@
426427
$adExtensions = CampaignManagementExampleHelper::GetAdExtensionsByIds(
427428
$GLOBALS['AuthorizationData']->AccountId,
428429
$adExtensionIds,
429-
$adExtensionsTypeFilter
430+
$adExtensionsTypeFilter,
431+
null
430432
)->AdExtensions;
431433
print("AdExtensions:\r\n");
432434
CampaignManagementExampleHelper::OutputArrayOfAdExtension($adExtensions);

samples/V13/AuthHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ static function AuthenticateWithOAuth()
197197

198198
static function RequestUserConsent()
199199
{
200-
print "You need to provide consent for the application to access your Bing Ads Bing Ads accounts. " .
200+
print "You need to provide consent for the application to access your Microsoft Advertising accounts. " .
201201
"Copy and paste this authorization endpoint into a web browser and sign in with a Microsoft account " .
202-
"with access to a Bing Ads account: \n\n" . $GLOBALS['AuthorizationData']->Authentication->GetAuthorizationEndpoint() .
203-
"\n\nAfter you have granted consent in the web browser for the application to access your Bing Ads accounts, " .
202+
"with access to a Microsoft Advertising account: \n\n" . $GLOBALS['AuthorizationData']->Authentication->GetAuthorizationEndpoint() .
203+
"\n\nAfter you have granted consent in the web browser for the application to access your Microsoft Advertising accounts, " .
204204
"please enter the response URI that includes the authorization 'code' parameter: \n\n";
205205

206206
$responseUri = fgets(STDIN);

samples/V13/CampaignManagementExampleHelper.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,8 @@ static function GetCampaignsByIds(
915915
}
916916
static function GetConversionGoalsByIds(
917917
$conversionGoalIds,
918-
$conversionGoalTypes)
918+
$conversionGoalTypes,
919+
$returnAdditionalFields)
919920
{
920921
$GLOBALS['CampaignManagementProxy']->SetAuthorizationData($GLOBALS['AuthorizationData']);
921922
$GLOBALS['Proxy'] = $GLOBALS['CampaignManagementProxy'];
@@ -924,12 +925,14 @@ static function GetConversionGoalsByIds(
924925

925926
$request->ConversionGoalIds = $conversionGoalIds;
926927
$request->ConversionGoalTypes = $conversionGoalTypes;
928+
$request->ReturnAdditionalFields = $returnAdditionalFields;
927929

928930
return $GLOBALS['CampaignManagementProxy']->GetService()->GetConversionGoalsByIds($request);
929931
}
930932
static function GetConversionGoalsByTagIds(
931933
$tagIds,
932-
$conversionGoalTypes)
934+
$conversionGoalTypes,
935+
$returnAdditionalFields)
933936
{
934937
$GLOBALS['CampaignManagementProxy']->SetAuthorizationData($GLOBALS['AuthorizationData']);
935938
$GLOBALS['Proxy'] = $GLOBALS['CampaignManagementProxy'];
@@ -938,6 +941,7 @@ static function GetConversionGoalsByTagIds(
938941

939942
$request->TagIds = $tagIds;
940943
$request->ConversionGoalTypes = $conversionGoalTypes;
944+
$request->ReturnAdditionalFields = $returnAdditionalFields;
941945

942946
return $GLOBALS['CampaignManagementProxy']->GetService()->GetConversionGoalsByTagIds($request);
943947
}
@@ -2821,6 +2825,7 @@ static function OutputConversionGoal($dataObject)
28212825
self::OutputStatusMessage(sprintf("TagId: %s", $dataObject->TagId));
28222826
self::OutputStatusMessage(sprintf("TrackingStatus: %s", $dataObject->TrackingStatus));
28232827
self::OutputStatusMessage(sprintf("Type: %s", $dataObject->Type));
2828+
self::OutputStatusMessage(sprintf("ViewThroughConversionWindowInMinutes: %s", $dataObject->ViewThroughConversionWindowInMinutes));
28242829
if($dataObject->Type === "AppInstallGoal")
28252830
{
28262831
self::OutputAppInstallGoal($dataObject);
@@ -6680,6 +6685,29 @@ static function OutputArrayOfConversionGoalType($valueSets)
66806685
}
66816686
self::OutputStatusMessage("* * * End OutputArrayOfConversionGoalType * * *");
66826687
}
6688+
static function OutputConversionGoalAdditionalField($valueSet)
6689+
{
6690+
self::OutputStatusMessage("* * * Begin OutputConversionGoalAdditionalField * * *");
6691+
self::OutputStatusMessage(sprintf("Values in %s", $valueSet->type));
6692+
foreach ($valueSet->string as $value)
6693+
{
6694+
self::OutputStatusMessage($value);
6695+
}
6696+
self::OutputStatusMessage("* * * End OutputConversionGoalAdditionalField * * *");
6697+
}
6698+
static function OutputArrayOfConversionGoalAdditionalField($valueSets)
6699+
{
6700+
if(count((array)$valueSets) == 0)
6701+
{
6702+
return;
6703+
}
6704+
self::OutputStatusMessage("* * * Begin OutputArrayOfConversionGoalAdditionalField * * *");
6705+
foreach ($valueSets->ConversionGoalAdditionalField as $valueSet)
6706+
{
6707+
self::OutputConversionGoalAdditionalField($valueSet);
6708+
}
6709+
self::OutputStatusMessage("* * * End OutputArrayOfConversionGoalAdditionalField * * *");
6710+
}
66836711
static function OutputConversionGoalCountType($valueSet)
66846712
{
66856713
self::OutputStatusMessage("* * * Begin OutputConversionGoalCountType * * *");

samples/V13/ConversionGoals.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
// the tracking script that you should add to your website is included in a corresponding
6767
// UetTag within the response message.
6868

69-
if ($uetTags == null || count($uetTags) < 1)
69+
if ($uetTags == null || count($uetTags->UetTag) < 1)
7070
{
7171
$addUetTags = array();
7272
$uetTag = new UetTag();
@@ -85,7 +85,7 @@
8585
CampaignManagementExampleHelper::OutputArrayOfBatchError($addUetTagsResponse->PartialErrors);
8686
}
8787

88-
if ($uetTags == null || count($uetTags) < 1)
88+
if ($uetTags == null || count($uetTags->UetTag) < 1)
8989
{
9090
printf(
9191
"You do not have any UET tags registered for CustomerId %s.\r\n",
@@ -262,7 +262,8 @@
262262
print("-----\r\nGetConversionGoalsByIds:\r\n");
263263
$getConversionGoalsByIdsResponse = CampaignManagementExampleHelper::GetConversionGoalsByIds(
264264
$conversionGoalIds,
265-
$conversionGoalTypes
265+
$conversionGoalTypes,
266+
null
266267
);
267268
$getConversionGoals = $getConversionGoalsByIdsResponse->ConversionGoals;
268269
print("ConversionGoals:\r\n");
@@ -385,7 +386,8 @@
385386
print("-----\r\nGetConversionGoalsByIds:\r\n");
386387
$getConversionGoalsByIdsResponse = CampaignManagementExampleHelper::GetConversionGoalsByIds(
387388
$conversionGoalIds,
388-
$conversionGoalTypes
389+
$conversionGoalTypes,
390+
null
389391
);
390392
$getConversionGoals = $getConversionGoalsByIdsResponse->ConversionGoals;
391393
print("ConversionGoals:\r\n");

samples/WebAuthentication/CallBingAdsServices.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@
5252
WebAuthHelper::GetApiEnvironment());
5353

5454
// Set the GetUser request parameter to an empty user identifier to get the current
55-
// authenticated Bing Ads user, and then search for all accounts the user may access.
55+
// authenticated Microsoft Advertising user, and then search for all accounts the user can access.
5656

5757
$getUserRequest = new GetUserRequest();
5858
$getUserRequest->UserId = null;
5959

6060
$user = $GLOBALS['CustomerManagementProxy']->GetService()->GetUser($getUserRequest)->User;
6161

62-
// Search for the Bing Ads accounts that the user can access.
62+
// Search for the Microsoft Advertising accounts that the user can access.
6363

6464
$pageInfo = new Paging();
6565
$pageInfo->Index = 0; // The first page

samples/WebAuthentication/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<h2>Bing Ads OAuth Demo</h2>
1818

19-
<p>This application would like to manage your Bing Ads data. Click below to login and authorize this application.</p>
19+
<p>This application would like to manage your Microsoft Advertising data. Click below to login and authorize this application.</p>
2020

2121
<p>When you click OK below, you'll be redirected to the following URI:</p>
2222
<p><?php echo WebAuthHelper::RedirectUri ?></p>

samples/WebAuthentication/OAuth2Callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
$_SESSION['state'] = $_SESSION['AuthorizationData']->Authentication->State;
4040

41-
// The user needs to provide consent for the application to access their Bing Ads accounts.
41+
// The user needs to provide consent for the application to access their Microsoft Advertising accounts.
4242
header('Location: '. $_SESSION['AuthorizationData']->Authentication->GetAuthorizationEndpoint());
4343
}
4444

src/Auth/Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
abstract class Authentication
99
{
1010
/**
11-
* The Authentication type, for example OAuthDesktopMobileImplicitGrant.
11+
* The Authentication type, for example OAuthDesktopMobileAuthCodeGrant.
1212
*/
1313
public $Type;
1414
}

src/Auth/AuthorizationData.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,26 @@
88
class AuthorizationData
99
{
1010
/**
11-
* An object representing the authentication headers that should be used in calls to the Bing Ads web services.
11+
* An object representing the authentication headers that should be used in calls to the Bing Ads API.
12+
* @var OAuthAuthorization
1213
*/
1314
public $Authentication;
1415

1516
/**
16-
* The identifier of the account that owns the entities in the request. Used as the CustomerAccountId header element in calls to the Bing Ads web services.
17+
* The identifier of the account that owns the entities in the request. Used as the CustomerAccountId header element in calls to the Bing Ads API.
18+
* @var string
1719
*/
1820
public $AccountId;
1921

2022
/**
21-
* The identifier of the customer that owns the account. Used as the CustomerId header element in calls to the Bing Ads web services.
23+
* The identifier of the customer that owns the account. Used as the CustomerId header element in calls to the Bing Ads API.
24+
* @var string
2225
*/
2326
public $CustomerId;
2427

2528
/**
26-
* The Bing Ads developer access token. Used as the DeveloperToken header element in calls to the Bing Ads web services.
29+
* The Bing Ads developer access token. Used as the DeveloperToken header element in calls to the Bing Ads API.
30+
* @var string
2731
*/
2832
public $DeveloperToken;
2933

0 commit comments

Comments
 (0)