# Zcash API returning 401

**URL:** <https://forum.zcashcommunity.com/t/zcash-api-returning-401/31524>\
**Category:** Technical Support\
**Created:** [October 8, 2018, 9:50am UTC](https://forum.zcashcommunity.com/t/zcash-api-returning-401/31524 "2018-10-08T09:50:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![parasjain](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@parasjain](https://forum.zcashcommunity.com/u/parasjain)\
**Post date:** [October 8, 2018, 9:50am UTC](https://forum.zcashcommunity.com/t/zcash-api-returning-401/31524/1 "2018-10-08T09:50:52Z")

</div>

Hi, I’m running zcashd on regtest mode. I’m trying to create a basic java application to check balance and other mundane stuff like zcash-cli, it’s just mine is a web version.

The problem is, when, I’m making an RPC call, the server is returning me 401, even though, I have no rpcuser and rpcpassword define in zcash.conf file.

```
##Zcash.conf
regtest=1
gen=1
genproclimit=-1

```

Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![garethtdavies](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/garethtdavies/32/210_2.png) [@garethtdavies](https://forum.zcashcommunity.com/u/garethtdavies)\
**Post date:** [October 8, 2018, 3:55pm UTC](https://forum.zcashcommunity.com/t/zcash-api-returning-401/31524/2 "2018-10-08T15:55:16Z")

</div>

It will still try to authenticate but it’ll fall back to using cookie authentication if no RPC user and password are set. It’s going to look in the data directory to handle the cookie auth so I’m guessing you’ll probably just want to set the username/password combo.
