Hello,
I have a problem with login-customer-id with the below versions of the
library,
*My client library and Google Ads API versions:*
-
Client library version: v17.1.0
-
Google Ads API version: V12
I already mentioned my account manager's customer id in
the google_adsapi.ini file as the below variable which developer token I
used,
loginCustomerId = "2215293344"
*Note: Already my manager accounts have basic access to developer tokens.*
Now, I create a campaign budget for my client, I passed his Google Ads
account customer Id and its showed me the error below,
Google\ApiCore\ApiException {#13541 #message: """ { "message": "The caller
does not have permission", "code": 7, "status": "PERMISSION_DENIED",
"details": [ { "@type":
"type.googleapis.com\/google.ads.googleads.v12.errors.GoogleAdsFailure",
"errors": [ { "errorCode": { "authorizationError": "USER_PERMISSION_DENIED"
}, "message": "User doesn't have permission to access customer. Note: If
you're accessing a client customer, the manager's customer id must be set
in the 'login-customer-id' header. See
https:\/\/developers.google.com\/google-ads\/api\/docs\/concepts\/call-structure#cid"
} ], "requestId": "r8gurevOJcJjN8XrnFX9Gg" } ] }
Also, I build my GoogleAdsClientBuilder with pass manual login customer id
as the below and checked with that to create a campaign budget but still,
same issues occur,
$oAuth2Configuration = (new ConfigurationLoader())->fromFile($storagepath);
$oAuth2Credential = (new
OAuth2TokenBuilder())->from($oAuth2Configuration)->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
->from($oAuth2Configuration) ->withOAuth2Credential($oAuth2Credential)
->withLoginCustomerId(2215293344) ->build();
I have integrated the below code for *create campaign budget*,
$uniqId = uniqid(); $budget = new CampaignBudget([ 'name' =>
'Interplanetary Cruise Budget #' . $uniqId, 'delivery_method' =>
BudgetDeliveryMethod::STANDARD, 'amount_micros' => $amount * 1000000 ]);
$campaignBudgetOperation = new CampaignBudgetOperation();
$campaignBudgetOperation->setCreate($budget); $campaignBudgetServiceClient
= $googleAdsClient->getCampaignBudgetServiceClient(); $response =
$campaignBudgetServiceClient->mutateCampaignBudgets( $customerId,
[$campaignBudgetOperation] ); $createdBudget = $response->getResults()[0];
Note: I passed my client's Google Ads account customer Id into $customerId.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/e76e6405-7722-45cb-90aa-0dc92825b1den%40googlegroups.com.