REST API queries give "Bad Gateway" and "Service Unavailable" errors with "fields" parameter

I’m using the REST API to retrieve data from Rocket, e.g. list of users. I’ve tested it with a few different methods with the “fields” parameter in the URL, including the example from the docs:

http://localhost:3000/api/v1/users.list?fields={ “username”: 1 }

I can retrieve the list of users if I leave out the ‘fields={“username”: 1}’ bit. However, as soon as I add that in I get either a “Bad Gateway” error or “Service Unavailable”.

Any ideas what might be wrong?

Thanks,
Stella

Anything in your server logs? Sounds like it’s doing something that causes the server to lock up.

We host it with rocket.chat, and I couldn’t see anything in the logs I had access to.

Thanks

You’ll need to open a ticket then so we can take a look.

Thanks!

Yeah I’ve done that since.

In the meantime I’ve changed my code to get all channels and then all members of each channel and got the info I need that way, but it’s a helluva lot of API calls where one would have to better.

Thanks for the help.

Stella