Hello,
I keep getting the error above on adding a budget when using PHP example
code from https://github.com/googleads/google-ads-php
(examples/BasicOperations/AddCampaigns.php) . I do have a test account and
the only thing I changed in the code was the account ID.
Various GET operations are running OK, although the result is mostly empty
as the account is new.
Do I have to set additional permissions somehow? I find the documentation
not quite aligning with reality in places.
I am using the ID of my test account. Do I have to create a customer
sub-account and use that for testing the API? When I try that, the only
error I get is USER_PERMISSION_DENIED.
Below is the result I get running the example file:
[2021-08-11T16:00:53.997292+02:00] google-ads.WARNING: Request made: Host:
"googleads.googleapis.com", Method:
"/google.ads.googleads.v8.services.CampaignBudgetService/MutateCampaignBudgets",
CustomerId: 7868560570, RequestId: "-M7Gbo0wtv4jblE2qXWg3A", IsFault: 1,
FaultMessage: "["The operation is not allowed for the given context."]"
[2021-08-11T16:00:53.999249+02:00] google-ads.NOTICE: Request
-------
Method Name:
/google.ads.googleads.v8.services.CampaignBudgetService/MutateCampaignBudgets
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.21 gapic\/ gax\/1.7.1 grpc\/1.38.0",
"x-goog-request-params": "customer_id=7868560570",
"developer-token": "REDACTED"
}
Request:
{"customerId":"7868560570","operations":[{"create":{"name":"Interplanetary
Cruise Budget
#2021-08-11T16:00:53.239+02:00","amountMicros":"500000","deliveryMethod":"STANDARD"}}]}
Response
-------
Headers: {
"request-id": "-M7Gbo0wtv4jblE2qXWg3A",
"date": "Wed, 11 Aug 2021 14:00:54 GMT",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\";
ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\";
ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\";
ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}
Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure:
{"errors":[{"errorCode":{"contextError":"OPERATION_NOT_PERMITTED_FOR_CONTEXT"},"message":"The
operation is not allowed for the given
context.","location":{"fieldPathElements":[{"fieldName":"operations","index":0}]}}],"requestId":"-M7Gbo0wtv4jblE2qXWg3A"}
Thank you for your help.
MH
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads 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/a116c2d2-d687-49b0-84e6-cd0383caaa4an%40googlegroups.com.