← 返回
未分类 Key 中文

Wake-up On LAN (WOL) API

Access WOL API to browse catering menu, place orders, check order history and balance, and manage event registrations including status and sign-up.
访问WOL API,浏览餐饮菜单、下单、查看订单历史和余额,以及管理活动报名(包括状态和报名)
onokje onokje 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 259
下载
💾 0
安装
1
版本
#latest

概述

WOL API

Interact with the Wake-up On LAN website via its REST API using curl. There are 2 major features: A catering system, and event registration system.

Step 1 — Resolve credentials

Run these two shell commands to check for environment variables:

echo "${WOL_API_TOKEN}"
echo "${WOL_BASE_URL}"
  • If WOL_API_TOKEN is empty, ask the user:

> "Please paste your API token, or configure the WOL_API_TOKEN environment variable. You can generate one at /user/api-tokens on the WOL site."

  • If WOL_BASE_URL is empty, asume https://wollan.nl as the base url.

Store the resolved values as TOKEN and BASE_URL for use in the commands below.

Step 2 — Dispatch on user intent

Look at $ARGUMENTS and/or the user's message to determine which action to take.


Catering: List products / show the menu

Trigger: $ARGUMENTS contains products, or the user asks what is available / what's on the menu.

curl -s \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE_URL/api/v1/catering/products"

Present the result grouped by category. For each product show:

  • Name
  • Price formatted as €X.XX (response values are in euro cents — divide by 100)
  • Stock status (inStock / out of stock)
  • Product ID (the user needs this to place an order)

Catering: Place an order

Trigger: $ARGUMENTS contains order, or the user says they want to order something.

Parse items from $ARGUMENTS in the format productId:quantity,... (e.g. order 3:2,5:1 means product 3 qty 2, product 5 qty 1). If no items are provided in $ARGUMENTS, ask the user which products and quantities they want (show the menu first if needed).

Assume a quantity of 1 if the user provides a product or list of products without quantities.

Build the JSON body and POST:

curl -s -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"productId": PRODUCT_ID, "quantity": QUANTITY}]}' \
  "$BASE_URL/api/v1/catering/orders"

On 201 Created: show a confirmation with the order ID, items, and total cost (sum of quantity × productPrice for all items, formatted as €X.XX).


Catering: View order history and account balance

Trigger: $ARGUMENTS contains history, is empty, or the user asks about their orders / balance.

curl -s \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE_URL/api/v1/catering/orders"

Present the account summary as a table:

Amount
--------------------------------
Total spent€X.XX
Total paid€X.XX
Balance (owed)€X.XX
Pending (in progress)€X.XX

Then list each order with its ID, date, status, and items. Only show the detailed order list if the user asks for it.

Order status meanings:

  • accepted — received, being prepared
  • waiting — queued behind other orders
  • ready — ready for pick-up
  • complete — picked up / done
  • cancelled / rejected — not fulfilled

Event registration: Check event status

Trigger: $ARGUMENTS contains eventstatus, or user asks if the WOL registrations are open or not

curl -s \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE_URL/api/v1/events/zijn-de-inschrijvingen-al-open-of-nie"

Returns: open: true|false, with eventId if true.

Event registration: Register for event

Trigger: $ARGUMENTS contains register, or user asks to register for the next WOL event.

Use "Check event status" to check if registrations are open or not, and if so, use that eventId to register the user with the following call:

curl -s -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  "$BASE_URL/api/v1/events/{eventId}/register"

The result is a simple success:true

Event registration: Check user registration status for an event

Trigger: $ARGUMENTS contains registration-status, or user asks to check his payment status for his registration for the next WOL event.

Use "Check event status" to check if registrations are open or not, and if so, use that eventId to check the users' registration status with the following call:

curl -s \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE_URL/api/v1/events/{eventId}/registration-status"

Error handling

HTTP statusMeaningAction
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
401 UnauthorizedToken invalid or expiredAsk the user to generate a new token at /user/api-tokens and set WOL_API_TOKEN
403 ForbiddenNot registered / not paid for the active event,User needs to register for the active event and pay on the WOL site
422 Unprocessable EntityValidation error. Check the error message for more details.Check the error message: if it mentions "disabled by crew", inform the user that ordering is temporarily paused and they should try again later; If out of stock: Inform the user that the product is out of stock and suggest an alternative product from the same category if available. If other message: Show the error message from the response; suggest running the products command to check availability (for catering endpoints)
503 Service UnavailableNo active catering event configuredInform the user the catering system has no active event; contact the site admin
500 Internal server errorSomething is wrong with the service, nothing the user can fix.Inform the user that there is a problem with the service, this is nothing the user can fix; contact the site admin

Notes

  • All monetary values in API responses are in euro cents. Always divide by 100 before displaying (250€2.50).
  • The curl -s flag suppresses progress output. Pipe through | python3 -m json.tool or similar if you want to inspect raw JSON.
  • Tokens are managed at /user/api-tokens (web UI, requires login). Each token can have a name and optional expiry date.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-23 16:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

business-ops

Discord

steipete
当需要通过discord工具控制Discord时使用:发送消息、添加反应、发布或上传表情包、上传表情、创建投票、管理帖子/置顶/搜索、获取权限或成员/角色/频道信息,或在Discord私信或频道中处理管理操作。
★ 79 📥 38,080
business-ops

Stripe

byungkyu
Stripe API 集成,支持托管 OAuth,实现对客户、订阅、发票、产品、价格和支付的可写金融集成。
★ 27 📥 26,065
business-ops

Trello

steipete
使用 Trello REST API 管理看板、列表和卡片
★ 162 📥 41,318