OPERATION_NOT_PERMITTED_FOR_CONTEXT

102 views
Skip to first unread message

Sergey Gusak

unread,
Nov 22, 2021, 6:24:21 PM11/22/21
to AdWords API and Google Ads API Forum
Hello,
Trying to request campaignBudgetMutate (Google Ads structure is MCC > Customer)
If use in configs CustomerID seeing this:
Failure:
Message: Status(StatusCode="InvalidArgument", Detail="Request contains an invalid argument.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1637623064.472000000","description":"Error received from peer ipv4:142.250.186.202:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1070,"grpc_message":"Request contains an invalid argument.","grpc_status":3}")
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": "4FXbvyotDzdHYave7pmPwg" }
Request ID: 4FXbvyotDzdHYave7pmPwg

If use in configs MCC ID seeing this:
Failure:
Message: Status(StatusCode="PermissionDenied", Detail="The caller does not have permission", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1637623447.830000000","description":"Error received from peer ipv4:142.250.203.138:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1070,"grpc_message":"The caller does not have permission","grpc_status":7}")
Failure: { "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": "9W3MpagerCsjGYlk_ixT_Q" }
Request ID: 9W3MpagerCsjGYlk_ixT_Q

Sergey Gusak

unread,
Nov 22, 2021, 6:49:47 PM11/22/21
to AdWords API and Google Ads API Forum
Sorry, I've mixed errors
Using CustomerID is cause of issue:
Failure:
Message: Status(StatusCode="PermissionDenied", Detail="The caller does not have permission", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1637623447.830000000","description":"Error received from peer ipv4:142.250.203.138:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1070,"grpc_message":"The caller does not have permission","grpc_status":7}")
Failure: { "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": "9W3MpagerCsjGYlk_ixT_Q" }
Request ID: 9W3MpagerCsjGYlk_ixT_Q

Using MCC ID:
Failure:
Message: Status(StatusCode="InvalidArgument", Detail="Request contains an invalid argument.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1637623064.472000000","description":"Error received from peer ipv4:142.250.186.202:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1070,"grpc_message":"Request contains an invalid argument.","grpc_status":3}")
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": "4FXbvyotDzdHYave7pmPwg" }
Request ID: 4FXbvyotDzdHYave7pmPwg

Google Ads API Forum Advisor

unread,
Nov 23, 2021, 12:26:14 AM11/23/21
to sgus...@gmail.com, adwor...@googlegroups.com
Hi Sergey,

Thank you for reaching out to us.

With regard to your concern, please do note that the API request to create campaign budget is for client account only. Since you're submitted a n API request using MCC account, then this is the reason why the OPERATION_NOT_PERMITTED_FOR_CONTEXT error occurred..

For USER_PERMISSION_DENIED, this error occurs when the authorized customer does not have access to the operating customer. You may check this guide for further details to the said error.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Teejay Wennie Pimentel
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RvRNp:ref

Sergey Gusak

unread,
Nov 23, 2021, 5:31:29 AM11/23/21
to AdWords API and Google Ads API Forum
Thanks, it works!
Added configData.Add("LoginCustomerId", "<MCC ID>"); // manager customer id must be without dashes (-)
to code and it processed

Reply all
Reply to author
Forward
0 new messages