List drinks #
Drinks on the menu, filtered by category.
参数 #
查询参数
categorystringcoffee | tea | seasonal
Only drinks of this category.
limitinteger1–100默认值 20
How many results to return.
响应 #
One page of drinks.
{
"data": [MenuItem[] · 必填
{MenuItem
"id": "mi_oat_latte",string · 必填
"name": "Oat latte",string · 必填
"category": "coffee",string · coffee | tea | seasonal · 必填
"price": {Money · 必填
"amount": 3200,integer · ≥ 0 · 必填
"currency": "CNY"string · CNY · 必填
}
},
… 还有 1 项
],
"next_cursor": nullstring | null
}
代码示例 #
curl "https://api.kawa-coffee.example/v2/menu-items?category=coffee" \
-H "Authorization: Bearer $TOKEN"const response = await fetch('https://api.kawa-coffee.example/v2/menu-items?category=coffee', {
headers: {
'Authorization': `Bearer ${TOKEN}`,
},
})
const data = await response.json()import os
import requests
response = requests.get(
"https://api.kawa-coffee.example/v2/menu-items",
params={"category": "coffee"},
headers={"Authorization": f"Bearer {os.environ["TOKEN"]}"},
)
data = response.json()

评论