java-samples icon indicating copy to clipboard operation
java-samples copied to clipboard

customer id could not be inferred from the request or caller identity.

Open amjf10 opened this issue 5 years ago • 3 comments

AlertCenter Quickstart

Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "customer id could not be inferred from the request or caller identity.", "reason" : "badRequest" } ], "message" : "customer id could not be inferred from the request or caller identity.", "status" : "INVALID_ARGUMENT" } at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:443) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1092) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:541) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:474) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:591) at AdminSDKAlertCenterQuickstart.main(AdminSDKAlertCenterQuickstart.java:86)

amjf10 avatar Jun 20 '20 01:06 amjf10

Running into the same thing trying to authenticate over Rest directly.

joey-mcadams avatar Sep 08 '22 14:09 joey-mcadams

Just a heads up. My fix for this.

I was using the service account ID when creating my JWT token instead of the admin account ID. When I switched those, everything seemed to work correctly.

joey-mcadams avatar Sep 08 '22 14:09 joey-mcadams

Hi @joey-mcadams, I am facing the same issue, Shall I use the previous version of google-api-services-alertcenter to get the alert center events.

usundarj avatar Oct 13 '22 03:10 usundarj