One dish, with what to buy for it
meals.dish.get
GET/api/v1/households/{household_id}/queries/meals.dish.get
- Query
- Rigel runs it
The dish with its name, whether it's eaten away from home, its icon, its recipe (id and title) and what to buy for it (products in order, with amount notes). A dish with a recipe has no ingredients of its own, so ingredients is empty: read the recipe (recipes.recipe.get) for its lines. The dish is null if there is no such dish.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
dish_idquerystringrequired | A dish ID, such as dsh_01JC0000000000000000000000. |
Response#
200 The answer.
| Field | Description |
|---|---|
dishobject or nullrequired | The dish, or null if there is no dish with that ID. |
dish.idstringrequired | A dish ID, such as dsh_01JC0000000000000000000000. |
dish.namestringrequired | The dish's name. |
dish.is_awaybooleanrequired | Eaten away from home, so it needs no groceries. |
dish.icon_file_idstring or nullrequired | The dish's icon, or null until one is generated. |
dish.recipe_idstring or nullrequired | The recipe the dish is made from, or null. |
dish.recipe_titlestring or nullrequired | That recipe's title, or null. |
dish.ingredientsarray of objectsrequired | What to buy for the dish, in order. Empty when none are recorded, and always empty for a dish with a recipe: its ingredients are the recipe's. |
dish.ingredients[].product_idstringrequired | A product ID, such as prd_01JC0000000000000000000000. |
dish.ingredients[].namestringrequired | The product's name. |
dish.ingredients[].amount_notestring or nullrequired | Free text about how much, such as "1 pack", or null. |
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
Examples#
These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.
Open a dish
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/meals.dish.get?dish_id=dsh_01M6V9CSF42115AECDV14HYQ9G' \
-H "Cookie: rigel_session=$RIGEL_SESSION"const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/meals.dish.get?dish_id=dsh_01M6V9CSF42115AECDV14HYQ9G", {
headers: {
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
});
const data = await response.json();GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/meals.dish.get?dish_id=dsh_01M6V9CSF42115AECDV14HYQ9G HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSH7KZPFC4FKXX13BZ2C
{
"dish": {
"id": "dsh_01M6V9CSF42115AECDV14HYQ9G",
"name": "Chicken thigh tacos",
"is_away": false,
"icon_file_id": null,
"recipe_id": null,
"recipe_title": null,
"ingredients": [
{
"product_id": "prd_01M6V9CSB2GBRX2QG46DDBK4TW",
"name": "Chicken thighs",
"amount_note": "about 2 lb"
},
{
"product_id": "prd_01M6V9CSFAPVK126M4A4P3X1QS",
"name": "Tortillas",
"amount_note": "8 small"
},
{
"product_id": "prd_01M6V9CSAMSN9ZJ52PTTKT8G6M",
"name": "Black beans",
"amount_note": "1 can"
}
]
}
}For Rigel#
Rigel's tool for this query is meals_dish_get. Rigel runs this on its own, then says what it did. The agent guide has the rest.