I'm getting OPERATION_NOT_PERMITTED_FOR_CONTEXT when trying to create a campaign budget using Google ads api

713 views
Skip to first unread message

Faith Amao

unread,
May 10, 2022, 11:16:12 PM5/10/22
to Google Ads API and AdWords API Forum
Hi

I'm getting an error when trying to create a campaign budget using Google Ads REST API

Here is my body request:
operations: [
{
create: {
type: "SMART_CAMPAIGN",
name: "bib jjghujjgg",
amountMicros: 5000000,
},
},
],
partialFailure: true,
validateOnly: true,
responseContentType: "MUTABLE_RESOURCE",

And my header:
headers: {
"content-type": "application/json",
Authorization: `Bearer ${accessToken}`,
"developer-token": developerToken,
"login-customer-id": customerId,
},

And here is the error:
"partialFailureError": {
"code": 3,
"message": "The operation is not allowed for the given context., at operations[0]",
"details": [
{
"errors": [
{
"errorCode": {
"contextError": "OPERATION_NOT_PERMITTED_FOR_CONTEXT"
},
"message": "The operation is not allowed for the given context.",
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": 0
}
]
}
}
]
}
]
}

Thanks for your help,
Faith.

Google Ads API Forum Advisor

unread,
May 12, 2022, 6:37:28 AM5/12/22
to amaof...@gmail.com, adwor...@googlegroups.com

Hi Faith,
 

Thanks for reaching out to the Google Ads API Support team.


With regard to your concern, It seems you have encountered a problem ContextError. That error said, The operation is not allowed for the given context. However, so our team can better check this concern, could you provide the request-id and customer-id to further investigation on this?
 

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.


Regards,

Google Logo
Darwin
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ariYM:ref

Faith Amao

unread,
May 12, 2022, 11:56:31 AM5/12/22
to Google Ads API and AdWords API Forum
"requestId": "yXdhrx2Dmow-Bmkz1kltZA" 
customerId = "6243662635"

Faith Amao

unread,
May 13, 2022, 4:20:30 PM5/13/22
to Google Ads API and AdWords API Forum
Can you please assist me with this

Google Ads API Forum Advisor

unread,
May 17, 2022, 3:43:10 AM5/17/22
to amaof...@gmail.com, adwor...@googlegroups.com
Hi Faith,

Thank you for providing the requested information. I work with Darwin and allow me to assist you here.

Upon checking the information, it appears that you are creating a campaign in the manager account. Unfortunately, in Google Ads API's perspective this is not possible as creating a campaign is only possible on a client account. This is also the reason why the error occurred. With this, please try creating a campaign on the client account. I hope it helps and let me know what goes after.

Best regards,
Google Logo
Jinky
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ariYM:ref

Faith Amao

unread,
May 17, 2022, 3:48:33 AM5/17/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Thank you for your response. 
I'll do that now and update you on the progress.

Thanks,
Faith.

Google Ads API Forum Advisor

unread,
May 17, 2022, 10:42:45 AM5/17/22
to amaof...@gmail.com, adwor...@googlegroups.com
Hi Faith,

Thank you for considering my insights. However, If you have additional questions regarding the topic being discussed in this thread, feel free to send those over to our team and we would be happy to assist you further.

Faith Amao

unread,
May 19, 2022, 2:56:59 PM5/19/22
to Google Ads API and AdWords API Forum
I have sent a message as "reply to author" please check and help me out, something is really at stake if this doesn’t work out ASAP 😭
Thanks

Faith Amao

unread,
May 19, 2022, 6:44:38 PM5/19/22
to Google Ads API and AdWords API Forum
I have figured it, thanks
Reply all
Reply to author
Forward
0 new messages