404 error response

181 views
Skip to first unread message

Md Abdul Aowal

unread,
May 29, 2023, 3:05:55 AM5/29/23
to Google Ads API and AdWords API Forum
var campaignData = new
            {
                campaign = new
                {
                    name = "My Campaign",
                    advertisingChannelType = "SEARCH",
                    status = "PAUSED",
                    startDate = "2023-06-01",
                    endDate = "2023-06-30",
                    budget = new
                    {
                        name = "My Budget",
                        deliveryMethod = "STANDARD",
                        amountMicros = 50000000
                    }
                }
            };

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

                var requestUrl = $"https://googleads.googleapis.com/v11/customers/{customerId}/campaigns";
                var content = new StringContent(JsonConvert.SerializeObject(campaignData), Encoding.UTF8, "application/json");

                var response = await client.PostAsync(requestUrl, content);

                if (response.IsSuccessStatusCode)
                {
                    var responseContent = await response.Content.ReadAsStringAsync();
                    Console.WriteLine("Campaign created successfully.");
                    Console.WriteLine(responseContent);
                }
                else
                {
                    Console.WriteLine($"Failed to create campaign. Status code: {response.StatusCode}");
                }
i gor 404 error response, can you please provide me google ads related rest api list with documentation?
thank

Google Ads API Forum Advisor

unread,
Jun 1, 2023, 3:53:28 AM6/1/23
to azad...@gmail.com, adwor...@googlegroups.com

Hi, 

Thank you for reaching out to Google Ads API Forum.

Moving forward with your concern, I can see in the code snippet you shared that you are still using the Google Ads API v11. Kindly note that as per this blog post (https://ads-developers.googleblog.com/2023/02/google-ads-api-v11-sunset-reminder.html), Google Ads API v11 has already sunset last March 29, 2023. After this date, all v11 API requests will begin to fail. This means the v11 API currently will not work anymore as all requests will begin to fail.

That said, you will have to migrate to a newer version of the Google Ads API to ensure your API access is unaffected. You may refer to this guide (https://developers.google.com/google-ads/api/docs/upgrade) when upgrading to the latest version. Additionally for mutating campaigns via REST interface, you may refer to this guide (https://developers.google.com/google-ads/api/rest/reference/rest/v13/customers.campaigns/mutate) for the REST endpoint. You may also check in this guide (https://developers.google.com/google-ads/api/rest/overview) for other rest methods in Google Ads API. 

Let us know how it goes on your end if this resolves your issue. If the error persists after trying the suggested solution, then you may provide to us the complete API logs (request and response with the request-id) generated when you encountered the said error. You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.


Reference links included in this email:

 

This message is in relation to case "ref:_00D1U1174p._5004Q2luGyj:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages