Code:
import { axios } from “@pipedream/platform”;
export default defineComponent({
props: {
google_ads: {
type: “app”,
app: “google_ads”,
},
customerId: {
type: “string”,
label: “Customer ID”,
},
locationIds: {
type: “string[]”,
label: “Location IDs”,
},
languageId: {
type: “string”,
label: “Language ID”,
},
keywordTexts: {
type: “string[]”,
label: “Keyword Texts”,
},
pageUrl: {
type: “string”,
label: “Page URL”,
},
},
async run({ $ }) {
const url = https://googleads.googleapis.com/v1/customers/${**this**.customerId}/googleAds:search
;
const query = test
; // Replace with the query you want to use
**const** response = **await** axios($, {
method: 'post',
url,
data: {
pageSize: 10,
query
},
headers: {
Authorization: `Bearer ${**this**.google_ads.$auth.access_token}`,
"Content-Type": "application/json",
"developer-token": "_fljZgxK5ofEFi54McNeqQ", _// Replace with your developer token_
},
});
**return** response;
},
});
Error:
Error - Request failed with status code 404
“!DOCTYPE html\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 <a href=<//www.google.com/>>\n
404. That’s an error.\n
The requested URL /v1/customers/999-882-8401/googleAds:search
was not found on this server. That’s all we know.\n”
DETAILS
at null.createError (/tmp/__pdg__/dist/code/063c55a4e5ebca21cd917214be56569db38fd75915c17acb1722ed2e32e8fe93/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/createError.js:16:15)
at null.settle (/tmp/__pdg__/dist/code/063c55a4e5ebca21cd917214be56569db38fd75915c17acb1722ed2e32e8fe93/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/tmp/__pdg__/dist/code/063c55a4e5ebca21cd917214be56569db38fd75915c17acb1722ed2e32e8fe93/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/adapters/http.js:269:11)
at IncomingMessage.emit (node:events:526:35)
at null.endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
steps.node{1}
debug{5}