Re: authentication_error: NOT_ADS_USER

2022-04-07 Thread XiuNan Liu
Yes, I have followed steps 1 and 2, but the problem still exists


在2022年4月7日星期四 UTC+8 15:07:52 写道:

> Hi,
>
>
> Thanks for your response.
>  
>
> Moving forward to your concern, can I confirm if you followed my colleague 
> provided about the Java client library setting for a service account as 
> discussed here 
> .
>  
>  If yes but the issue still persists, let me know so that I can raise it to 
> the team for further checking and to address the issue.
>
>
> Regards,
> [image: Google Logo] 
> Darwin 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2ZJ5so:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b29618a0-b8c8-4d8a-afae-a96e513eb9cbn%40googlegroups.com.


Re: authentication_error: NOT_ADS_USER

2022-04-06 Thread XiuNan Liu
Please help me submit my questions. For my business, the service account is 
the best solution, so I hope I can give priority to the service account

在2022年4月6日星期三 UTC+8 22:10:52 写道:

> Hi,
>
>
> I am also a member of the Google Ads API team and let me provide support 
> to your concern.
>
> I would like to inform you that I will remove your recent post with API 
> logs for privacy purposes. Moving forward, before I raise the issue to the 
> team, could you confirm if you already followed the Java client library 
> setting for service account as discussed here 
> .
>  
> If yes but the issue still persists, let me know so that I can raise it to 
> the team for further checking and to address the issue.
>
> Also, we strongly recommend using OAuth2 desktop app or web app flow 
> 
>  
> instead of service accounts *unless you need a domain-specific feature* 
> (for example, impersonation). OAuth2 desktop app and web app flows do 
> require an initial user interaction for granting access to the account, but 
> are much simpler to set up.
>
> For the OAuth2 desktop app flow 
> ,
>  
> you can persist a refresh token (which never expires) to obtain a new 
> access token whenever necessary. When using one of our client libraries 
> , 
> you can authorize your app by filling out a configuration file.
>
> Regards,
> [image: Google Logo] 
> Ernie John 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2ZJ5so:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2fd7d94b-7fa8-433b-bdda-90cdfc438e6fn%40googlegroups.com.


Re: authentication_error: NOT_ADS_USER

2022-04-06 Thread XiuNan Liu
Request
---
MethodName: google.ads.googleads.v10.services.GoogleAdsService/SearchStream
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=1340476946, 
x-goog-api-client=gl-java/1.8.0_60 gccl/17.0.1 gapic/17.0.1 gax/2.6.1 
grpc/1.27.2}
Body: customer_id: "1340476946"
query: "SELECT campaign.id, campaign.name FROM campaign ORDER BY 
campaign.id"


Response

Headers: 
Metadata(content-type=application/grpc,request-id=TSlvnpdQA3nlJ3ZaeE41uA,date=Wed,
 
06 Apr 2022 07:50:06 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; 
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: errors {
  error_code {
authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
request_id: "TSlvnpdQA3nlJ3ZaeE41uA"

Status: Status{code=UNAUTHENTICATED, description=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., 
cause=null}.
15:50:07.609 [grpc-nio-worker-ELG-1-4] DEBUG 
io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler - [id: 0xf88c96ea, 
L:/127.0.0.1:57219 - R:/127.0.0.1:7890] OUTBOUND GO_AWAY: lastStreamId=0 
errorCode=0 length=0 bytes=
Exception in thread "main" 
com.google.ads.googleads.v10.errors.GoogleAdsException: errors {
  error_code {
authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
request_id: "TSlvnpdQA3nlJ3ZaeE41uA"

at 
com.google.ads.googleads.v10.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:42)
at 
com.google.ads.googleads.v10.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:34)
at 
com.google.ads.googleads.lib.stubs.exceptions.BaseGoogleAdsException$Factory.createGoogleAdsException(BaseGoogleAdsException.java:105)
at 
com.google.ads.googleads.lib.callables.GoogleAdsExceptionTransformation.transform(GoogleAdsExceptionTransformation.java:39)
at 
com.google.ads.googleads.lib.stubs.callables.ExceptionTransformingServerStreamingCallable$ExceptionTransformingStreamObserver.onError(ExceptionTransformingServerStreamingCallable.java:71)
at 
com.google.api.gax.tracing.TracedResponseObserver.onError(TracedResponseObserver.java:103)
at 
com.google.api.gax.rpc.RetryingServerStreamingCallable$1.onFailure(RetryingServerStreamingCallable.java:99)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at 
com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1041)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1215)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)
at 
com.google.api.gax.retrying.BasicRetryingFuture.handleAttempt(BasicRetryingFuture.java:200)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.handle(CallbackChainRetryingFuture.java:135)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.run(CallbackChainRetryingFuture.java:117)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1215)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)
at 
com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)
at 
com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)
at 
com.google.api.core.SettableApiFuture.setException(SettableApiFuture.java:52)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable.onAttemptError(ServerStreamingAttemptCallable.java:378)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable.access$600(ServerStreamingAttemptCallable.java:97)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable$2.onErrorImpl(ServerStreamingAttemptCallable.java:249)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 
com.google.api.gax.rpc.Watchdog$WatchdogStream.onErrorImpl(Watchdog.java:284)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 
com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:84)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 

Re: authentication_error: NOT_ADS_USER

2022-04-06 Thread XiuNan Liu
Request
---
MethodName: google.ads.googleads.v10.services.GoogleAdsService/SearchStream
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=1340476946, 
x-goog-api-client=gl-java/1.8.0_60 gccl/17.0.1 gapic/17.0.1 gax/2.6.1 
grpc/1.27.2}
Body: customer_id: "1340476946"
query: "SELECT campaign.id, campaign.name FROM campaign ORDER BY 
campaign.id"


Response

Headers: 
Metadata(content-type=application/grpc,request-id=TSlvnpdQA3nlJ3ZaeE41uA,date=Wed,
 
06 Apr 2022 07:50:06 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; 
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: errors {
  error_code {
authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
request_id: "TSlvnpdQA3nlJ3ZaeE41uA"

Status: Status{code=UNAUTHENTICATED, description=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., 
cause=null}.
15:50:07.609 [grpc-nio-worker-ELG-1-4] DEBUG 
io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler - [id: 0xf88c96ea, 
L:/127.0.0.1:57219 - R:/127.0.0.1:7890] OUTBOUND GO_AWAY: lastStreamId=0 
errorCode=0 length=0 bytes=
Exception in thread "main" 
com.google.ads.googleads.v10.errors.GoogleAdsException: errors {
  error_code {
authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
request_id: "TSlvnpdQA3nlJ3ZaeE41uA"

at 
com.google.ads.googleads.v10.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:42)
at 
com.google.ads.googleads.v10.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:34)
at 
com.google.ads.googleads.lib.stubs.exceptions.BaseGoogleAdsException$Factory.createGoogleAdsException(BaseGoogleAdsException.java:105)
at 
com.google.ads.googleads.lib.callables.GoogleAdsExceptionTransformation.transform(GoogleAdsExceptionTransformation.java:39)
at 
com.google.ads.googleads.lib.stubs.callables.ExceptionTransformingServerStreamingCallable$ExceptionTransformingStreamObserver.onError(ExceptionTransformingServerStreamingCallable.java:71)
at 
com.google.api.gax.tracing.TracedResponseObserver.onError(TracedResponseObserver.java:103)
at 
com.google.api.gax.rpc.RetryingServerStreamingCallable$1.onFailure(RetryingServerStreamingCallable.java:99)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at 
com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1041)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1215)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)
at 
com.google.api.gax.retrying.BasicRetryingFuture.handleAttempt(BasicRetryingFuture.java:200)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.handle(CallbackChainRetryingFuture.java:135)
at 
com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.run(CallbackChainRetryingFuture.java:117)
at 
com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at 
com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1215)
at 
com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)
at 
com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)
at 
com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)
at 
com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)
at 
com.google.api.core.SettableApiFuture.setException(SettableApiFuture.java:52)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable.onAttemptError(ServerStreamingAttemptCallable.java:378)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable.access$600(ServerStreamingAttemptCallable.java:97)
at 
com.google.api.gax.rpc.ServerStreamingAttemptCallable$2.onErrorImpl(ServerStreamingAttemptCallable.java:249)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 
com.google.api.gax.rpc.Watchdog$WatchdogStream.onErrorImpl(Watchdog.java:284)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 
com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:84)
at 
com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
at 

Re: authentication_error: NOT_ADS_USER

2022-04-05 Thread XiuNan Liu
Thanks for help,

I think I have operated according to the document. My account is Google Ad 
Manager Account. I used this account to create a service account, and also 
used this account to apply for a developer token

Then I add service account id and google ad 
scope( https://www.googleapis.com/auth/adwords) on admin.google.com

在2022年4月4日星期一 UTC+8 10:35:36 写道:

> Hi,
>
> Thank you for reaching out to the Google Ads API support team.
>
> The NOT_ADS_USER 
> 
>  
> error usually occurs when the login used to generate the access token is 
> not associated with any Google Ads account. Make sure to log in with a 
> valid Google Ads account (typically your manager account) for the OAuth 
> flow.
>
> Could you please confirm if you’ve indeed followed every step of the 
> service account guide 
>  
> , specifically the prerequisites 
> 
>  
> ?
>
> Best regards,
> [image: Google Logo] 
> Heidi 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2ZJ5so:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8792c6e2-ae75-4462-9243-2894ab681cb7n%40googlegroups.com.


Re: authentication_error: NOT_ADS_USER

2022-04-02 Thread XiuNan Liu
Code:

GoogleCredentials credentials = GoogleCredentials.fromStream
(new 
FileInputStream("robotic-aviary.json")).createScoped("https://www.googleapis.com/auth/adwords;,
 "https://www.googleapis.com/auth/adsensehost;, 
"https://www.googleapis.com/auth/adsense;);
 
credentials.refreshIfExpired();
GoogleAdsClient googleAdsClient = GoogleAdsClient.newBuilder
().setCredentials(credentials).setDeveloperToken(developerToken
).setLoginCustomerId(Long.valueOf(customerId)).build();
try (GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
String query = "SELECT campaign.id, campaign.name FROM campaign ORDER BY 
campaign.id";
// Constructs the SearchGoogleAdsStreamRequest.
SearchGoogleAdsStreamRequest request =
SearchGoogleAdsStreamRequest.newBuilder()
.setCustomerId(customerId)
.setQuery(query)
.build();

// Creates and issues a search Google Ads stream request that will retrieve 
all campaigns.
ServerStream stream =
googleAdsServiceClient.searchStreamCallable().call(request);

// Iterates through and prints all of the results in the stream response.
for (SearchGoogleAdsStreamResponse response : stream) {
for (GoogleAdsRow googleAdsRow : response.getResultsList()) {
System.out.printf(
"Campaign with ID %d and name '%s' was found.%n",
googleAdsRow.getCampaign().getId(), googleAdsRow.getCampaign().getName());
}
}

Log:
Request
---
MethodName: google.ads.googleads.v10.services.GoogleAdsService/SearchStream
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=134xx, 
x-goog-api-client=gl-java/1.8.0_60 gccl/17.0.1 gapic/17.0.1 gax/2.6.1 
grpc/1.27.2}
Body: customer_id: " 134xx  "
query: "SELECT campaign.id, campaign.name FROM campaign ORDER BY 
campaign.id"


Response

Headers: 
Metadata(content-type=application/grpc,request-id=6vd9tHbU6pTfNbX_KtJ6PQ,date=Sat,
 
02 Apr 2022 06:25:39 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; 
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: errors {
  error_code {
authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
request_id: "6vd9tHbU6pTfNbX_KtJ6PQ"


在2022年4月2日星期六 UTC+8 14:33:59 写道:

> When calling ads API with service account, I returned error getting access 
> token for service account: 401 unauthorized
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9ea04d06-899e-4e84-860c-ec91d11a52f1n%40googlegroups.com.