Skip to content

API and webhooks ​

Permissions ​

ScopeGrants
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>.

MethodRouteScopeQueryData
GET/nay_car_wash/v1/historynay_car_wash.history.readidentifier, 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/statsnay_car_wash.stats.readdays (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/tunnelsnay_car_wash.tunnels.readindex, 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.

EventWhenData
nay_car_wash.washA tunnel wash is completed.player (name), identifier, tunnel, program, price
nay_car_wash.manualA 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.