Contents
On this page
Save Custom Field Values - Plugixa Stream
PUT /plugixa-stream/v1/admin/series/{id}/custom-fields
Set some of a title’s custom field values. Keys you leave out are unchanged; keys that are not a field are ignored.
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/series/2681/custom-fields
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The title’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
values |
object |
Yes | Field key => value. Each value is cleaned for its type: a select must be one of its options, a date is Y-m-d, a number must be numeric. An empty or invalid value clears the field. |
{
"values": {
"director_cut": true,
"festival": "Netherlands Film Festival 2010"
}
}
Responses
200 OK. data is every value, as stored.
{
"success": true,
"data": {
"director_cut": true,
"festival": "Netherlands Film Festival 2010"
}
}
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks the capability. |
404 |
plugixa_stream_not_found |
No title with that id. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2681/custom-fields" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"values":{"director_cut":true,"festival":"Netherlands Film Festival 2010"}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2681/custom-fields');
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([
'values' => [
'director_cut' => true,
'festival' => 'Netherlands Film Festival 2010',
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2681/custom-fields', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ values: { director_cut: true, festival: 'Netherlands Film Festival 2010' } }),
});
const { data } = await response.json();
Quick Links
Share