API and webhooks
Permissions
| Scope | Grants |
|---|---|
nay_car_wash.config | /nay:carwash (tunnel editor) and the Car Wash settings in /nay. |
Grant it with ACE or a rule, see Permissions.
HTTP API
Turn the API on and create a token first, see HTTP API. Routes answer { "ok": true, "data": ... } and need Authorization: Bearer <token>.
| Method | Route | Scope | Query | Data |
|---|---|---|---|---|
| GET | /nay_car_wash/v1/history | nay_car_wash.history.read | identifier, kind (tunnel or manual), limit (1 to 100, default 20), before (id) | items (id, identifier, kind, location, program, price, time), newest first, and next: pass it as before for the next page. |
| GET | /nay_car_wash/v1/stats | nay_car_wash.stats.read | days (1 to 31, default 7), utcOffset (minutes, -720 to 840, default: the server clock) | utcOffset used, total, byDay (every day listed) and byLocation, each with washes and revenue. |
| GET | /nay_car_wash/v1/tunnels | nay_car_wash.tunnels.read | index, label, enabled, entry for each tunnel. |
Example:
bash
curl -H "Authorization: Bearer nay_1_xxxxxxxx" "https://api.example.com/nay_car_wash/v1/stats?days=7"Webhook events
Pick them in the Webhooks tab of /nay, see Webhooks.
| Event | When | Data |
|---|---|---|
nay_car_wash.wash | A tunnel wash is completed. | player (name), identifier, tunnel, program, price |
nay_car_wash.manual | A pressure washer session ends. | player (name), identifier, station, price |
With a Discord webhook, each wash becomes an embed in your channel, in the server language.