Contents
Save Home Rows - Plugixa Stream
PUT /plugixa-stream/v1/admin/rows
Replace every home row at once. The order you send is the order on the home screen.
Needs a user with the plugixa_stream_edit capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.
Request
PUT https://your-site.example/wp-json/plugixa-stream/v1/admin/rows
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
rows |
object[] |
Yes | The rows, at most 20; more are dropped. |
rows[].id |
string |
No | Lowercase letters, digits, - and _. Made from the type and 6 random characters when empty. |
rows[].title |
string |
No | The heading. |
rows[].type |
string |
No | manual (the default), featured, new, genre, trending; with Pro also top_rated. |
rows[].kind |
string |
No | series or movie; empty for both. |
rows[].series_ids |
integer[] |
No | For manual: the titles, in order. |
rows[].term_id |
integer |
No | For genre: the genre id. |
rows[].limit |
integer |
No | 1 to 30. Defaults to 12. |
{
"rows": [
{
"id": "new",
"title": "New releases",
"type": "new",
"kind": "movie",
"limit": 12
},
{
"title": "Editor's picks",
"type": "manual",
"series_ids": [2814, 2681]
}
]
}
Responses
200 OK. data is the rows as stored.
{
"success": true,
"data": [
{
"id": "new",
"title": "New releases",
"type": "new",
"kind": "movie",
"series_ids": [],
"term_id": 0,
"limit": 12
},
{
"id": "manual-k3P9xQ",
"title": "Editor's picks",
"type": "manual",
"kind": "",
"series_ids": [2814, 2681],
"term_id": 0,
"limit": 12
}
]
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
string |
The row’s id |
data[].title |
string |
Its heading |
data[].type |
string |
manual, featured, new, genre, trending; with Pro also top_rated |
data[].kind |
string |
series, movie, or empty for both. Ignored by manual rows |
data[].series_ids |
integer[] |
The hand-picked titles of a manual row, in order |
data[].term_id |
integer |
The genre of a genre row |
data[].limit |
integer |
Most titles shown, 1 to 30 |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks the capability. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-stream/v1/admin/rows" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"rows":[{"id":"new","title":"New releases","type":"new","kind":"movie","limit":12},{"title":"Editor's picks","type":"manual","series_ids":[2814,2681]}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/rows');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'rows' => [
[
'id' => 'new',
'title' => 'New releases',
'type' => 'new',
'kind' => 'movie',
'limit' => 12,
],
[
'title' => 'Editor\'s picks',
'type' => 'manual',
'series_ids' => [2814, 2681],
],
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/rows', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ rows: [{ id: 'new', title: 'New releases', type: 'new', kind: 'movie', limit: 12 }, { title: 'Editor\'s picks', type: 'manual', series_ids: [2814, 2681] }] }),
});
const { data } = await response.json();
Quick Links
Share