Management APIs don't work with valid token from java code

Managment API works with curl but gives 404 from java code with the same token. Not sure how to resolve this. Below is my code snippet

**public** User findUser(String email) **throws** Auth0Exception {


ManagementAPI managementAPI = **new** ManagementAPI(audience, "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im9vcmp6ajZKTUhrdTc3SkVPdWlEeSJ9.eyJpc3MiOiJodHRwczovL2Rldi1yOWJzbGpxaC51cy5hdXRoMC5jb20vIiwic3ViIjoiQkxCazJzTzR2QTZ1VWdPRklVUlhPdXNMR09qT3NJeWtAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGV2LXI5YnNsanFoLnVzLmF1dGgwLmNvbS9hcGkvdjIvIiwiaWF0IjoxNjQzNTk4NjA4LCJleHAiOjE2NDM2ODUwMDgsImF6cCI6IkJMQmsyc080dkE2dVVnT0ZJVVJYT3VzTEdPak9zSXlrIiwic2NvcGUiOiJyZWFkOmNsaWVudF9ncmFudHMgY3JlYXRlOmNsaWVudF9ncmFudHMgZGVsZXRlOmNsaWVudF9ncmFudHMgdXBkYXRlOmNsaWVudF9ncmFudHMgcmVhZDp1c2VycyB1cGRhdGU6dXNlcnMgZGVsZXRlOnVzZXJzIGNyZWF0ZTp1c2VycyByZWFkOnVzZXJzX2FwcF9tZXRhZGF0YSB1cGRhdGU6dXNlcnNfYXBwX21ldGFkYXRhIGRlbGV0ZTp1c2Vyc19hcHBfbWV0YWRhdGEgY3JlYXRlOnVzZXJzX2FwcF9tZXRhZGF0YSByZWFkOnVzZXJfY3VzdG9tX2Jsb2NrcyBjcmVhdGU6dXNlcl9jdXN0b21fYmxvY2tzIGRlbGV0ZTp1c2VyX2N1c3RvbV9ibG9ja3MgY3JlYXRlOnVzZXJfdGlja2V0cyByZWFkOmNsaWVudHMgdXBkYXRlOmNsaWVudHMgZGVsZXRlOmNsaWVudHMgY3JlYXRlOmNsaWVudHMgcmVhZDpjbGllbnRfa2V5cyB1cGRhdGU6Y2xpZW50X2tleXMgZGVs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jwKq8jEXDZTQmh3O5PIvfkN34mpndNeOZIzp11PAfc9Edf5CuvKeYlI52-MS--NfsHNRngiB6HVOY6mtalGruosEfWrDE1uSr4xazkmeriPOM6Ge42m4j3kA");

HttpUtils. *recordRequestInfoToLog* ("{\"email\":\"" + email + "\"}", ***LOGGER*** );

**try** {

Request<List<User>> users = managementAPI.users().listByEmail(email, **null** );

**if** (users != **null** ) {

List<User> user = users.execute();

**if** (user.size() == 0) {

**return** **null** ;

}

***LOGGER*** .info("Auth0 findUser response has been received for " + email);

**return** user.get(0);

}

**return** **null** ;

} **catch** (APIException e) {

**throw** e;

} **catch** (Auth0Exception e) {

**throw** e;

}

}

Hi @svyavahare14,

Welcome to the Auth0 Community!

Can you please the name and version of the Auth0 SDK you are using?

I am going to mark this as resolved, please create a new topic if the issue persists.