404 error HTTP Oauth > Google ads API

Hi All,

I’m trying to use an HTTP Make an oAuth 2.0 request to retrieve Google ads keyword data.

I set up a connection following this guide , and I thought it was set up correctly. However, when I try to run the module, I get a 404 error when running the HTTP module.** Any idea whats causing this, as to my knowledge it seems correct?

Setup:


JSON request content
{
“customerId”: “9561946005”,
“language”: {
“resourceName”: “languageConstants/1000”
},
“geoTargetConstants”: [
{
“resourceName”: “geoTargetConstants/2392”
},
{
“resourceName”: “geoTargetConstants/2036”
}
],
“keywordPlanNetwork”: “GOOGLE_SEARCH”,
“keywordSeed”: {
“keywords”: [
“kinderslaapproblemen”,
“slaapproblemen baby”,
“slaaptips kinderen”,
“baby slaapt niet”,
“kind slaapt slecht”,
“slaaprituelen kind”,
“slaaptraining baby”,
“slaapcoach kinderen”,
“slaapgewoontes kinderen”,
“slaapproblemen peuter”,
“kind moeilijk in slaap”,
“slaaptherapie kind”,
“slaap tips baby”,
]
}
}

However, it get the 404 in my output:

[
{
“ca”: null,
“qs”: ,
“url”: “https://googleads.googleapis.com/v10/customers/9561946005/keywordPlans:generateKeywordIdeas”,
“data”: “{\n "customerId": "9561946005",\n "language": {\n "resourceName": "languageConstants/1000"\n },\n "geoTargetConstants": [\n {\n "resourceName": "geoTargetConstants/2392"\n },\n {\n "resourceName": "geoTargetConstants/2036"\n }\n ],\n "keywordPlanNetwork": "GOOGLE_SEARCH",\n "keywordSeed": {\n "keywords": [\n "kinderslaapproblemen",\n "slaapproblemen baby",\n "slaaptips kinderen",\n "baby slaapt niet",\n "kind slaapt slecht",\n "slaaprituelen kind",\n "slaaptraining baby",\n "slaapcoach kinderen",\n "slaapgewoontes kinderen",\n "slaapproblemen peuter",\n "kind moeilijk in slaap",\n "slaaptherapie kind",\n "slaap tips baby",\n ]\n }\n}”,
“gzip”: true,
“method”: “post”,
“headers”: [
{
“name”: “Authorization”,
“value”: “Bearer ya29.a0AXooCgtz7KUo_TpDNPLvbJjb3rGwnNZt0IFwgWe6-uNs1usjgcguNPUmgFcRN1BRJl5pLYaAzOHi8qUwnvB41TNHEkvOhPmtniqFRgLIbcZNS1aXF0eoijDxVl0DJBdUul2fubiq9Mg7CWvi0_pMnQ-4LjSkKbMFyluwaCgYKAUESARASFQHGX2MideBDi63cuom3xlhR2DnJVw0171
},
{
“name”: “Content-Type”,
“value”: “application/json”
}
],
“timeout”: null,
“useMtls”: false,
“bodyType”: “raw”,
“contentType”: “application/json”,
“serializeUrl”: false,
“shareCookies”: false,
“parseResponse”: true,
“followRedirect”: true,
“useQuerystring”: false,
“followAllRedirects”: false,
“rejectUnauthorized”: true
}
]

[
{
“statusCode”: 404,
“headers”: [
{
“name”: “date”,
“value”: “Wed, 19 Jun 2024 09:22:26 GMT”
},
{
“name”: “content-type”,
“value”: “text/html; charset=UTF-8”
},
{
“name”: “server”,
“value”: “ESF”
},
{
“name”: “content-length”,
“value”: “1619”
},
{
“name”: “x-xss-protection”,
“value”: “0”
},
{
“name”: “x-frame-options”,
“value”: “SAMEORIGIN”
},
{
“name”: “x-content-type-options”,
“value”: “nosniff”
},
{
“name”: “alt-svc”,
“value”: “h3=":443"; ma=2592000,h3-29=":443"; ma=2592000”
},
{
“name”: “connection”,
“value”: “close”
}
],
“cookieHeaders”: ,
“data”: “\n\n \n <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">\n Error 404 (Not Found)!!1\n \n {margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px} > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n \n \n

404. That’s an error.\n

The requested URL /v10/customers/9561946005/keywordPlans:generateKeywordIdeas was not found on this server. That’s all we know.\n”,
“fileSize”: 1619
}
]

Any idea what to correct in order to solve the 404?

Hello!

Usually, 404 errors mean that your URL is incorrect. I did a little search and couldn’t find the type of URL you use. Seems like now the Google Ads API is in version 17 (not any more 10).
Can you give me the URL of the documentation or example where you got this API from?

Besides, if your authentication is correctly configured, you should not have to add an Authorization Header in the request; it should be automatically added by your Connection.

Benjamin

2 Likes

Hi Benjamin, I got this from your make.com GPT within chatgpt. See below

Here I followed all the steps. However if the gpt uses outdated information, please share the link with the correct instructions?

Any update on how to solve this???

How to create an OAuth app in GCP: https://www.make.com/en/help/tutorials/calling-google-apis-via-the--http-make-a-oauth-2-0-request--module ← FOLLOW THIS

1a. Enable the relevant API

Find the relevant API here: Google Cloud console
Go to API page, end click “Enable”

1b. Add the relevant scopes

Direct Link: https://console.cloud.google.com/apis/credentials/consent/edit

2. Insert all the known Google Redirect URIs for your app

Direct Link: https://console.cloud.google.com/apis/credentials

Here are some known redirect URIs you need for your Google Cloud Console OAuth app. If you set these up, you can reuse the same GCP app for other Google apps and modules on Make.

Once you’ve set these up, you can use/reuse the same Make connection for all the supported Google apps & modules on Make - you’ll only have to enable the APIs for your custom app.

3. Publish your GCP OAuth2 app

Direct Link: https://console.cloud.google.com/apis/credentials/consent

You might need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.

1. To do this, go to menu item “OAuth consent screen”

or click here https://console.cloud.google.com/apis/credentials/consent

2. Then click the button below if the Publishing status is not “In production”

4. Set up connection (HTTP OAuth, or respective Google App)

A. HTTP OAuth2

You need a “Authorize parameters” key of redirect_uri with the above Make OAuth2 callback URL.

You can find the Client ID and Client Secret in the OAuth2 app you created in GCP, on the right-hand side of where you inserted the 8 callback URLs in step 2:

B. Google App

Insert the GCP app client ID and secret here BEFORE clicking “Sign in”
Gmail example:

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

2 Likes