REST API Query Fails on Public App

Hello,

I’ve built an app that needs to be accessed publicly, with no login.
The app uses a REST API resource to query/patch our DB (Directus).

The resource authenticates with a Bearer Token:

If I access the public app while logged in to Retool everything works as expected.

But if I access it while I’m not logged in, the UI loads but the query fails with a status of 400.

What do I need to change to have the query work in Public mode when the users are not logged in to Retool (while keeping the DB authentication secure)?

Many thanks,

Ellie

Resolved, the Public app is connected to the production environment by default.
The queries were only set up in staging.
Adding _environment=staging as a url parameter allowed the queries to run

1 Like

Thanks for following up with an update, @Eleonora_Celiento! Glad to hear it's working.