Mutate Budget REST / JSON

86 views
Skip to first unread message

Ed Johnson

unread,
Mar 13, 2022, 12:51:03 AM3/13/22
to Google Ads API and AdWords API Forum
Hello,

I am trying to make a request to the Google Ads API using the REST APIs and not the SDKs, but I am getting an invalid argument response.

After setting the appropriate headers, the JSON I am sending to "https://googleads.googleapis.com/v10/customers/{AccountNumber}/campaignBudgets:mutate" is as follows:

{
operations: [
{
updateMask: "amount_micros",
update:{
resourceName: "customers/{AccountNumber}/campaignBudgets/{BudgetID}",
amount_micros: "60000000"
}
}
]
}

I am not sure if the response below is telling me the BudgetID I am sending can't be found or something else. I am retrieving the BudgetID in a prior call using the campaign_budget.id field:

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.ads.googleads.v10.errors.GoogleAdsFailure",
        "errors": [
          {
            "errorCode": {
              "mutateError": "RESOURCE_NOT_FOUND"
            },
            "message": "Resource was not found.",
            "trigger": {
              "int64Value": "{BudgetID}"
            },
            "location": {
              "fieldPathElements": [
                {
                  "fieldName": "operations",
                  "index": 0
                },
                {
                  "fieldName": "update"
                },
                {
                  "fieldName": "resource_name"
                }
              ]
            }
          }
        ],
        "requestId": "7Fc0P_Mbl9N842_xbI-A2A"
      }
    ]
  }
}


Thanks in advance for any information you might be able to provide.


Google Ads API Forum Advisor

unread,
Mar 13, 2022, 9:52:00 PM3/13/22
to edxjo...@gmail.com, adwor...@googlegroups.com
Hi Ed,

Thank you for posting your concern.

To further investigate the issue, could you provide the complete request and response logs with request ID and request header generated on your end without redacted fields and where we can see the error?

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

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Ykpi5:ref

Ed Johnson

unread,
Mar 14, 2022, 1:10:31 AM3/14/22
to Google Ads API and AdWords API Forum
Hi Ernie,

I was responding to you privately and going through the data sent when I realized I was parsing the budget ID incorrectly so the ID was in fact incorrect. Once I corrected that, everything worked great!

My apologies for sending this question, I thought I had double and triple checked everything before doing so and I guess I missed something.

Take care.

Ed

Google Ads API Forum Advisor

unread,
Mar 14, 2022, 2:58:45 AM3/14/22
to edxjo...@gmail.com, adwor...@googlegroups.com

Hi Ed,

Thanks for updating us on the issue. We’re glad to know that your issue has been resolved after passing budget ID correctly. Please don’t hesitate to reach out to us again if you have any queries related to our API.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Ykpi5:ref
Reply all
Reply to author
Forward
0 new messages