Change one aisle's label, sign text or sign photo
shopping.aisle.update
POST/api/v1/households/{household_id}/commands/shopping.aisle.update
- Command
- Rigel runs it
- Applies offline
Sets only the fields given. Send contents or photo_file_id as null to clear them. To reorder or add aisles use shopping.aisle.set.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Idempotency-Keyheaderstringoptional | The command's ID. Reuse it when retrying the same command. |
Request body#
JSON, as application/json.
| Field | Description |
|---|---|
aisle_idstringrequired | The aisle to change. |
labelstringoptional | The aisle or section's label: "Aisle 5", "Produce", "Deli", as written, 1–80 characters. |
contentsstring or nulloptional | What the sign lists, or null to clear it. |
photo_file_idstring or nulloptional | A photo of the sign, already uploaded as a file, or null to remove it. |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
versionintegerrequired | The household version after the command. |
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 | aisle_not_found | An aisle that isn't there. |
404 | file_not_found | A photo that isn't there. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | idempotency_key_reused | The Idempotency-Key was already used for a different command. |
Examples#
These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.
Sets only the fields given
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"aisle_id": "ais_01JC000000000000000000000A",
"label": "Aisle 1 - Pasta"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
aisle_id: "ais_01JC000000000000000000000A",
label: "Aisle 1 - Pasta",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"aisle_id": "ais_01JC000000000000000000000A",
"label": "Aisle 1 - Pasta"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R05RTAH3ACZHMP0THV
{
"result": {},
"version": 1
}Clears the sign text and sets a photo
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"aisle_id": "ais_01JC000000000000000000000A",
"contents": null,
"photo_file_id": "fil_01JC000000000000000000000A"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
aisle_id: "ais_01JC000000000000000000000A",
contents: null,
photo_file_id: "fil_01JC000000000000000000000A",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"aisle_id": "ais_01JC000000000000000000000A",
"contents": null,
"photo_file_id": "fil_01JC000000000000000000000A"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H21PD6S3N9XPTA77
{
"result": {},
"version": 1
}An aisle that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"aisle_id": "ais_01JC000000000000000000000A",
"label": "x"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
aisle_id: "ais_01JC000000000000000000000A",
label: "x",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"aisle_id": "ais_01JC000000000000000000000A",
"label": "x"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09ZK2ES90T0VMRK6B
{
"error": {
"code": "aisle_not_found",
"message": "That aisle isn't there any more. No changes were applied.",
"details": {
"aisle_id": "ais_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R09ZK2ES90T0VMRK6B"
}
}A photo that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"aisle_id": "ais_01JC000000000000000000000A",
"photo_file_id": "fil_01JC000000000000000000000B"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
aisle_id: "ais_01JC000000000000000000000A",
photo_file_id: "fil_01JC000000000000000000000B",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"aisle_id": "ais_01JC000000000000000000000A",
"photo_file_id": "fil_01JC000000000000000000000B"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R00BS99ET8ZMF8K456
{
"error": {
"code": "file_not_found",
"message": "That file isn't there any more. No changes were applied.",
"details": {
"file_id": "fil_01JC000000000000000000000B"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R00BS99ET8ZMF8K456"
}
}Change what an aisle's sign says
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CT723H5ZBJ6JCXAVVPC1' \
-d '{
"aisle_id": "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
"label": "Aisle 3",
"contents": "Paper goods, cleaning, first aid"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CT723H5ZBJ6JCXAVVPC1",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
aisle_id: "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
label: "Aisle 3",
contents: "Paper goods, cleaning, first aid",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/shopping.aisle.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT723H5ZBJ6JCXAVVPC1
{
"aisle_id": "ais_01M6V9CT70QB5HHFQCH5HEANWJ",
"label": "Aisle 3",
"contents": "Paper goods, cleaning, first aid"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT72BYN6SPB2W463VXZE
{
"result": {},
"version": 266
}For Rigel#
Rigel's tool for this command is shopping_aisle_update. Rigel runs this on its own, then says what it did. The agent guide has the rest.