# How do I lookup if a users email address exists in the Java API?

**URL:** <https://community.auth0.com/t/how-do-i-lookup-if-a-users-email-address-exists-in-the-java-api/8616>\
**Category:** Get Help\
**Tags:** java\
**Created:** [October 30, 2017, 1:50am UTC](https://community.auth0.com/t/how-do-i-lookup-if-a-users-email-address-exists-in-the-java-api/8616 "2017-10-30T01:50:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![horsephotostechnolog](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@horsephotostechnolog](https://community.auth0.com/u/horsephotostechnolog)\
**Post date:** [October 30, 2017, 1:50am UTC](https://community.auth0.com/t/how-do-i-lookup-if-a-users-email-address-exists-in-the-java-api/8616/1 "2017-10-30T01:50:23Z")

</div>

From your starter example I have code that looks like this:

domain = config.getServletContext().getInitParameter(“com.auth0.domain”);  
clientId = config.getServletContext().getInitParameter(“com.auth0.clientId”);  
clientSecret = config.getServletContext().getInitParameter(“com.auth0.clientSecret”);

ManagementAPI managementAPI = new ManagementAPI(domain, clientId);

```
UsersEntity usersEntity = managementAPI.users();

```

Request auth0Request = usersEntity.get(email, null);

```
    auth0Request.execute();

```

When I execute this I get an error of:  
Request failed with status code 400: Bad HTTP authentication header format

In the Docs around APIToken:  
This string exists:  
See the “Getting an API token” section to learn how to obtain a token.  
Googling this in many forms does not get me to a guide on this topic. It be nice to have a URL for this at minimum.

Even more important it would be great to have some sample code so I know what the heck it is I should do and not have to live in the API designers head!!!

Thanks in advance for any help you can provide.

Jim

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/how-do-i-lookup-if-a-users-email-address-exists-in-the-java-api/8616/2 "2018-03-02T05:57:12Z")

</div>


