Why am I getting 401 errors on my Google Ads workflow and why does the app/integration appear as invalid?

are you able to do other calls?

e.g…

import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    google_ads: {
      type: "app",
      app: "google_ads",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://googleads.googleapis.com/v15/customers:listAccessibleCustomers`,
      headers: {
        Authorization: `Bearer ${this.google_ads.$auth.oauth_access_token}`,
        'developer-token': '[REDACTED]',
      },
    })
  },
})

list accessible customers

if you’re able to make that call, perhaps it may be an API versioning issue

cool. let me try

fails with the same error:

AxiosError - Request failed with status code 401
{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"OAUTH_TOKEN_HEADER_INVALID"},"message":"Oauth token HTTP header is malformed."}],"requestId":"wNQS7h6yMCSRU-n1dAhI_A"}]}}

Can you try starting fresh in a new workflow, add a Google Ads code step, reconnect your account, and try running that step again?

I’m not sure why you’re encountering a 401 error when the base call to test that your token is working seems to succeed

I might know what’s going on. Did you change pipedream’s internal developer-token ?

Yes, this was recently rotated*

I think this is the issue. I had pipedream’s developer id in my code. It seems this is needed for this particular part of the api. Can you share the new one? I don’t think it’s a secret since I had the one before that

Sorry for the issue here, Pedro.

I’m disabling the app for now while we look into a solution for this - the Pipedream internal developer token should not have been visible in the past, as it is a secret that is treated like an API credential. Unfortunately I am not able to share the newly rotated credential, as this needs to be kept private.

I’ll regroup with the team to find a solution to be able to have this available to use for our users, but not visible.

I will follow up with you when we have an update.

Ok thanks. In the meantime I was able to revert back to my previous code that doesn’t rely on the app. Btw, do you know how can I fix that “Your current plan does not include access to shared connected accounts” issue?

Sorry for the inconvenience. Could you send a note over to support@pipedream.com for the accounts issue and they should be able to assist?

sure. thanks