Opteo / google-ads-api

Google Ads API client library for Node.js
https://opteo.com
MIT License
269 stars 90 forks source link

Unable to retrieve list of accessible customers with refresh token #499

Open DrewHang opened 2 months ago

DrewHang commented 2 months ago

Hello as suggested in the documentation, anyone have any idea why this isn't working - when I use that code snippet below I get the following error:

Error: 12 UNIMPLEMENTED: GRPC target method can't be resolved.
    at callErrorFromStatus (node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (node_modules/@grpc/grpc-js/build/src/client.js:193:76)
    at Object.onReceiveStatus (node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /data/papaya/node_modules/@grpc/grpc-js/build/src/resolving-call.js:129:78
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (node_modules/@grpc/grpc-js/build/src/client.js:161:32)
    at ServiceClientImpl.<anonymous> (node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at node_modules/google-ads-node/build/src/v14/customer_service_client.js:347:29
    at node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at repeat (/data/papaya/node_modules/google-gax/build/src/normalCalls/retries.js:80:25)
    at node_modules/google-gax/build/src/normalCalls/retries.js:119:13
    at OngoingCallPromise.call (node_modules/google-gax/build/src/call.js:67:27)
    at NormalApiCaller.call (node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
    at node_modules/google-gax/build/src/createApiCall.js:112:30
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  code: 12,
  details: "GRPC target method can't be resolved.",
  metadata: Metadata { internalRepr: Map(0) {}, options: {} },
  note: 'Exception occurred in retry method that was not classified as transient'
}
const client = new GoogleAdsApi({
  client_id: "<CLIENT-ID>",
  client_secret: "<CLIENT-SECRET>",
  developer_token: "<DEVELOPER-TOKEN>",
});

const refreshToken = "<REFRESH-TOKEN>";

const customers = await client.listAccessibleCustomers(refreshToken);
BenCash88 commented 1 month ago

I am also experiencing this issue.