Contents
On this page
My Shopping List - Plugixa Recipe
GET /plugixa-recipe/v1/frontend/shopping-list
Read the one shopping list the front end keeps for the signed-in user.
Needs any signed-in WordPress user, a subscriber included: a visitor with an account, signed in with the site cookie and nonce or an Application Password. Needs Plugixa Recipe Pro with the Shopping Lists app on.
Request
GET https://your-site.example/wp-json/plugixa-recipe/v1/frontend/shopping-list
Responses
200 OK. data is the lines of the list.
{
"success": true,
"data": [
{
"name": "flour",
"quantity": "2",
"unit": "cups",
"checked": false
},
{
"name": "lemons",
"quantity": "2",
"unit": "",
"checked": true
}
]
}
| Field | Type | Meaning |
|---|---|---|
data[].name |
string |
The line |
data[].quantity, data[].unit |
string |
As written |
data[].checked |
boolean |
Ticked off |
The response is sent with Cache-Control: no-store, private. A user who never saved a list gets an empty array.
Errors
| Status | Code | When |
|---|---|---|
401 |
rest_forbidden |
The request is not signed in. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-recipe/v1/frontend/shopping-list" \
-u "jane:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/frontend/shopping-list');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'jane:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`jane:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/frontend/shopping-list', {
headers: {
'Authorization': auth,
},
});
const { data } = await response.json();
Quick Links
Share