Get a drink #
参数 #
路径参数
itemIdstring必填
响应 #
The drink.
{
"id": "mi_oat_latte",string · 必填
"name": "Oat latte",string · 必填
"category": "coffee",string · coffee | tea | seasonal · 必填
"price": {Money · 必填
"amount": 0,integer · ≥ 0 · 必填
"currency": "CNY"string · CNY · 必填
}
}
Nothing has this id.
{
"type": "https://example.com/resource",string(uri) · 必填
"title": "title",string · 必填
"detail": "detail",string
"errors": [object[]
{object
"field": "field",string
"message": "message"string
}
]
}
代码示例 #
curl "https://api.kawa-coffee.example/v2/menu-items/mi_oat_latte" \
-H "Authorization: Bearer $TOKEN"const response = await fetch('https://api.kawa-coffee.example/v2/menu-items/mi_oat_latte', {
headers: {
'Authorization': `Bearer ${TOKEN}`,
},
})
const data = await response.json()import os
import requests
response = requests.get(
"https://api.kawa-coffee.example/v2/menu-items/mi_oat_latte",
headers={"Authorization": f"Bearer {os.environ["TOKEN"]}"},
)
data = response.json()

评论